Click here to Skip to main content
15,894,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have a email with body . i want to have a html page embedded inside the mail body , and my html page will have some links and textbox to search and navigate .

Any suggestions please.

Rohit
Posted

You can put HTML inside a message body, just wrap it in HTML tags.

However, you should know that you probably won't get the behavior you desire. There are a number of popular email clients out there and they all handle messages differently. Many will only display the message as text and will ignore anything wrapped in HTML tags. Many that will display HTML are likely to block image downloads for images in the HTML by default (it is a privacy hole). You are likely to find that most clients will also block any active components by default (such as flash), scripting, and probably POST operations as well. Email clients usually (and rightfully) distrust email content and try to keep it in a sandbox. This really limits what you can and can't do. It has been used as an attack vector so many times, nobody trusts email any more.
 
Share this answer
 
string v_sendMailUserName = "userName";//
string v_sendMailPassword = "userPwd";//
string v_sendMailAddress ="xx@xx.com";//
string v_receiveMailAddress ="xx@xx.com";//
string v_mailSubject = "";//


SmtpClient smtp = new SmtpClient(v_smtpAddress);
smtp.Credentials = new System.Net.NetworkCredential(v_sendMailUserName, v_sendMailPassword);
MailMessage mes = new MailMessage();

mes.From = new MailAddress(v_sendMailAddress);
mes.To.Add(v_receiveMailAddress);

mes.Subject = v_mailSubject;
mes.Body = @"

this is test!

";
mes.IsBodyHtml = true;//set html format
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900