need help to send email with background images and text with top of background?

Posted by Prabu_Spark under ASP.NET on 3/5/2014 | Points: 10 | Views : 751 | Status : [Member] | Replies : 0
Hi sir,
Tell me the steps to send email with background images and text with top of background. I tried the below code the text and background will appear separately. Kindly give me the solution for this problem.


string path = Server.MapPath(@"images/prof_bg.jpg"); // my logo is placed in images folder

LinkedResource logo = new LinkedResource(path);
logo.ContentId = "companylogo";
// done HTML formatting in the next line to display my logo
AlternateView av1 = AlternateView.CreateAlternateViewFromString("<html><body background=cid:companylogo><br><h1></h1></body></html>"+"Hi this is J.Prabu", null, MediaTypeNames.Text.Html);

MailMessage MyMailMessage = new MailMessage("", "");

MyMailMessage.Subject = "Testing Mail";

string Body = "<b>Welcome to popfly!!</b><br><img alt=\"\" hspace=0 src=\"cid:imageId\" align=baseline border=0 >";

AlternateView htmlView = AlternateView.CreateAlternateViewFromString(Body, null, "text/html");

LinkedResource imagelink = new LinkedResource(Server.MapPath(@"images/prof_bg.jpg"), "image/jpeg");

imagelink.ContentId = "imageId";

imagelink.TransferEncoding = System.Net.Mime.TransferEncoding.Base64;



MyMailMessage.IsBodyHtml = true;
NetworkCredential mailAuthentication = new NetworkCredential("", "123");
SmtpClient mailClient = new SmtpClient("", 587);
mailClient.EnableSsl = true;
mailClient.UseDefaultCredentials = false;
mailClient.Credentials = mailAuthentication;
mailClient.EnableSsl = true;

With regards,


(No response found.)

Login to post response