Sending images in html mail
-
Hello, I have the follwing code: public static void SendNewsletter ( string Address, StringCollection scPictures, string Text ) { MailMessage mm = new MailMessage(); mm.To = Address; mm.Body = Text; mm.From = "XXX@XXX.coml"; mm.Subject = "Your weekly newsletter"; mm.BodyFormat = MailFormat.Html; foreach ( string s in scPictures ) mm.Attachments.Add ( new MailAttachment (s)); SmtpMail.Send ( mm ); } In outlook and outlook express the images appear just in the HTML and the recipent gets to see perfect HTML page, but the images also appear as seperate attachements!!! When I get newsletters in HTML hte attachmetns are never visible! What am I doing wrong? Any help appreciated Henk
-
Hello, I have the follwing code: public static void SendNewsletter ( string Address, StringCollection scPictures, string Text ) { MailMessage mm = new MailMessage(); mm.To = Address; mm.Body = Text; mm.From = "XXX@XXX.coml"; mm.Subject = "Your weekly newsletter"; mm.BodyFormat = MailFormat.Html; foreach ( string s in scPictures ) mm.Attachments.Add ( new MailAttachment (s)); SmtpMail.Send ( mm ); } In outlook and outlook express the images appear just in the HTML and the recipent gets to see perfect HTML page, but the images also appear as seperate attachements!!! When I get newsletters in HTML hte attachmetns are never visible! What am I doing wrong? Any help appreciated Henk
Well from your code, you are attaching the images as attachments. Outlook Express will preview a picture attachment for you, that is why you are seeing it in the message. Typically what html newsleters do is have a full html page that is sent and the images are not in the mail message, but usually they refer to a web server. This keeps the email messages small. Steve Maier, MCSD