Author |
|
noachtheroach Newbie
Joined: 04 December 2006 Location: United Kingdom
Online Status: Offline Posts: 1
|
Posted: 04 December 2006 at 1:02pm | IP Logged
|
|
|
Here's the basic rundown of the app:
I have an app that acts as round robin emailer. It uses POP3 to download the email in a central mailbox from gmail, and then emails that email in a round-robin around a list of email addresses. So theres email1@gmail.com that gets all the incoming email which is then sent to the next in order among email2, email3, email4, and email5 @gmail.com.
The method of emailing:
I create a POP3 object to download the messages and save all the attachments to a temporary directory. I then create an SMTP object, let's call it mailer, I set mailer.BodyHtmlText = message.BodyHtmlText, mailer.BodyPlainText = message.PlainText, loop through the attachments and do a mailer.AddAttachment() to attach them all back from the temp directory & mailer.Send().
The problem:
Embedded images no longer show up in the email. I just see a broken image where the image used to show. I don't know if this is specific to Gmail, which is why i mention it. Anyone have any ideas?
|
Back to Top |
|
|
Andrew AfterLogic Support
Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 05 December 2006 at 3:18am | IP Logged
|
|
|
The embedded images no longer show up in the email because in the original message all the embedded images had special Content IDs (CIDs) which are referenced in HTML and thus it's possible to determine where each embedded image should be displayed. When your application is rebuilding the message with using AddAttachment method, the same images are added with other/new CIDs, but HTML still refers to the old CIDs.
Why not send the original messages received through POP3? Like the below (in C# syntax):
Code:
Smtp mailer = new Smtp();
mailer.SmtpServers.Add("mail.domain.com", "jdoe", "secret");
Pop3 pop = new Pop3();
pop.Connect("mail.domain.com");
pop.Login("jdoe", "secret");
MailMessageCollection msgs = pop.DownloadEntireMessages();
foreach (MailMessage msg in msgs)
{
mailer.Message = msg;
mailer.Message.To.AsString = "email2@gmail.com";
mailer.Send();
}
pop.Disconnect(); |
|
|
Best regards,
Andrew
|
Back to Top |
|
|