hi i need to set header content type in c#. when i send mail from c#, i'm getting the mail with html tags. how can set content type in mail sending code?
A:
In case that you asking how can I send email in c#:
MailMessage mail = new MailMessage(); mail.To = "[email protected]"; mail.From = "[email protected]"; mail.Subject = "this is a test email."; mail.Body = "this is my test email body"; mail.IsBodyHtml = false; SmtpMail.SmtpServer = "localhost"; //your real server goes here SmtpMail.Send( mail );
Source: here.
Mendy
2010-02-10 05:38:35
+1
A:
MailMessage mail = new MailMessage();
// need to set this property
mail.IsBodyHtml = false;
For more alterations, you can do with templates in your email, see
Hope this helps
Asad Butt
2010-02-10 05:46:01
thanks.. it's working fine.
kumar_v
2010-02-10 11:42:23