0

0 down vote favorite

I am trying send Newsletter with images, I am able to send email but not getting images, I tried to search lots of solution but its not working.Please check this link for Simple Newsletter

When I am trying to email this newsletter, I am getting newsletter without images. I put hard coded images in html file, like <img src=http://www.abc.com/images/xyz.jpg /> Here my simple code for sending email :

MailMessage myMail;

using (StreamReader reader = File.OpenText(Server.MapPath("Newsletter.html"))) // Path to your 
{                                                         // HTML file
    myMail = new MailMessage();
    myMail.From = new MailAddress("email@domain.com.au");
    myMail.Subject = "Test News Letter";
    myMail.To.Add("se@yahoo.com.au");
    myMail.IsBodyHtml = true;

    myMail.Body = reader.ReadToEnd();  // Load the content from your file...

}
SmtpClient smtp = new SmtpClient("xx.xx.xx.y", 25);
smtp.UseDefaultCredentials = true;

NetworkCredential cred = new NetworkCredential("email@domain.com.au", "hakoo");
smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
smtp.Credentials = cred;
smtp.Send(myMail);

Can anyone help me to solve this issues?

Thanks,

Hakoo Desai.

2
Contributors
1
Reply
13
Views
4 Years
Discussion Span
Last Post by geniusvishal
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.