Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: Embedded images when forwarding email Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
noachtheroach
Newbie
Newbie


Joined: 04 December 2006
Location: United Kingdom
Online Status: Offline
Posts: 1
Posted: 04 December 2006 at 1:02pm | IP Logged Quote noachtheroach

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 View noachtheroach's Profile Search for other posts by noachtheroach
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 05 December 2006 at 3:18am | IP Logged Quote Andrew

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 View Andrew's Profile Search for other posts by Andrew
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide