Dart Home | PowerTCP Mail for ActiveX | Custom Development | Reply | PowerTCP Mail for ActiveX Topics | Forums |
Author | Forum: PowerTCP Mail for ActiveX Topic: IMAP LISTSERV APP |
steadman1 steadmand@gmail.com From: Leesburg, VA USA Posts: 14 Member Since: 05/04/07 |
posted July 10, 2007 11:58 AM I have a listserv app that I modified using tour IMAP sample.. when I have embedded images in the email the One issue when I go to compose.asx and send the email it can't be viewed in outlook.. I can send my code to see what i am doing wrong.. I modified the view.asp to rewrite the embedded images to be viewable : |
steadman1 steadmand@gmail.com From: Leesburg, VA USA Posts: 14 Member Since: 05/04/07 |
posted July 10, 2007 12:01 PM PART 1 to view.aspx.vb HERE IS THE MODIFIED THE VIEW.ASPX.VB Select Case TextPart.ContentType Case "text/plain" 'If TextPart.ContentEncoding.ToString = "QuotedPrintable" Then 'MessageText = MessageText + vbCrLf + "--" + vbCrLf + vbCrLf MessageTextstr = GetHtml(TextPart.Text) 'MessageTextstr = MessageTextstr + GetHtml(TextPart.Text) 'End If Case "image/jpeg" SessionManager.filenamestr = TextPart.FileName SessionManager.contentidstr = TextPart.ContentId Dim buffer() As Byte = New Byte((TextPart.Length) - 1) {} TextPart.Content.Position = 0 TextPart.Content.Read(buffer, 0, buffer.Length) Dim filetodelete As String 'filetodelete = ("E:\listserv\WebForms\" + TextPart.FileName.ToString) 'filetodelete = ("C:\" + TextPart.FileName.ToString) filetodelete = ("C:\Inetpub\listserv\WebForms\" + TextPart.FileName.ToString) If System.IO.File.Exists(filetodelete) = True Then System.IO.File.Delete(filetodelete) End If Dim FS As FileStream = New FileStream("C:\Inetpub\listserv\WebForms\" + |
steadman1 steadmand@gmail.com From: Leesburg, VA USA Posts: 14 Member Since: 05/04/07 |
posted July 10, 2007 12:02 PM PART 2 TextPart.FileName.ToString, FileMode.CreateNew, FileAccess.Write) 'Dim FS As FileStream = New FileStream("E:\listserv\WebForms\" + TextPart.FileName.ToString, FileMode.CreateNew, FileAccess.Write) 'Dim FS As FileStream = New FileStream("C:\" + TextPart.FileName.ToString, FileMode.CreateNew, FileAccess.Write) FS.Write(buffer, 0, buffer.Length) FS.Close() Case "image/png" SessionManager.filenamestr = TextPart.FileName SessionManager.contentidstr = TextPart.ContentId Dim buffer() As Byte = New Byte((TextPart.Length) - 1) {} TextPart.Content.Position = 0 TextPart.Content.Read(buffer, 0, buffer.Length) Dim filetodelete As String 'filetodelete = ("E:\listserv\WebForms\" + TextPart.FileName.ToString) 'filetodelete = ("C:\" + TextPart.FileName.ToString) filetodelete = ("C:\Inetpub\listserv\WebForms\" + TextPart.FileName.ToString) If System.IO.File.Exists(filetodelete) = True Then System.IO.File.Delete(filetodelete) End If Dim FS As FileStream = New FileStream("C:\Inetpub\listserv\WebForms\" + TextPart.FileName.ToString, FileMode.CreateNew, FileAccess.Write FS.Close() Case "image/gif" SessionManager.filenamestr = TextPart.FileName SessionManager.contentidstr = TextPart.ContentId Dim buffer() As Byte = New Byte((TextPart.Length) - 1) {} TextPart.Content.Position = 0 TextPart.Content.Read(buffer, 0, buffer.Length) Dim filetodelete As String 'filetodelete = ("E:\listserv\WebForms\" + TextPart.FileName.ToString) 'filetodelete = ("C:\" + TextPart.FileName.ToString) filetodelete = ("C:\Inetpub\listserv\WebForms\" + TextPart.FileName.ToString) If System.IO.File.Exists(filetodelete) = True Then System.IO.File.Delete(filetodelete) End If Dim FS As FileStream = New FileStream("C:\Inetpub\listserv\WebForms\" + TextPart.FileName.ToString, FileMode.CreateNew, FileAccess.Write) |
steadman1 steadmand@gmail.com From: Leesburg, VA USA Posts: 14 Member Since: 05/04/07 |
posted July 10, 2007 12:02 PM PART 3 'Dim FS As FileStream = New FileStream("E:\listserv\WebForms\" + TextPart.FileName.ToString, FileMode.CreateNew, FileAccess.Write) 'Dim FS As FileStream = New FileStream("C:\" + TextPart.FileName.ToString, FileMode.CreateNew, FileAccess.Write) FS.Write(buffer, 0, buffer.Length) FS.Close() Case "text/html" MessageText = MessageText + GetHtml(TextPart.Text) 'Response.Write(SessionManager.contentidstr + " ----- " + SessionManager.filenamestr) If SessionManager.contentidstr = "" Then Else MessageText = MessageText.Replace("cid:", "") MessageText = MessageText.Replace(SessionManager.contentidstr, SessionManager.filenamestr) End If End Select Next 'If Message has Complex Parts, Recursively call this Procedure Dim ComplexPart As MessageStream For Each ComplexPart In Part.Parts.Complex GetText(ComplexPart, MessageText) Next Exit Function End Function |
Amit From: Rome, NY USA Posts: 315 Member Since: 03/15/06 |
posted July 18, 2007 2:56 PM Hello, I have sent you a mail. Please check it and let me know your observations. Regards, Amit |
Arjun From: Rome, NY, USA Posts: 137 Member Since: 09/17/07 |
posted February 6, 2008 5:10 PM Hello, Here is the resolution given over the email: How are you looking to receive the attachment? As a normal attachment or as an inline attachment (in this the attachment image will be part of the text of the message like HTML messages with images embedded with text). The MessageStream.Parts.Simple contains all inline Mime parts. Here is a small code snippet which sends mail with a normal attachment: Dim msg As New MessageStream() msg.To.Add(New MailAddress("ToAddress")) msg.From = New MailAddress("FromAddress") msg.Subject = "Subject" msg.Text = "Text" msg.Attachments.Add("") Smtp1.Server = "ServerName" Smtp1.Send(msg) MsgBox("done") I would also suggest you to search for the Inline parts in the help file and you should be able to get the required information from there. Regards, Arjun |
Reply | PowerTCP Mail for ActiveX Topics | Forums |
This site is powered by PowerTCP WebServer for ActiveX |