1

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?

Kumar V
  • 8,810
  • 9
  • 39
  • 58

2 Answers2

1

In case that you asking how can I send email in c#:

MailMessage mail = new MailMessage();
mail.To = "me@mycompany.com";
mail.From = "you@yourcompany.com";
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.

Fitzchak Yitzchaki
  • 9,095
  • 12
  • 56
  • 96
1
    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

Community
  • 1
  • 1
Asad
  • 21,468
  • 17
  • 69
  • 94