Mails in HTML format

  • Thread starter Thread starter Johnny Jörgensen
  • Start date Start date
J

Johnny Jörgensen

How do you tell the program that a mail (System.Net.Mail.MailMessage) is in
HTML format (VS 2005).

In earlier versions of VS there was a property called BodyFormat that you
could set to BodyFormat.HTML.

That doesn't seem to exist anymore in VS 2005 though?

Any ideas?

TIA,
Johnny J.
 
How do you tell the program that a mail (System.Net.Mail.MailMessage) is in
HTML format (VS 2005).

In earlier versions of VS there was a property called BodyFormat that you
could set to BodyFormat.HTML.

That doesn't seem to exist anymore in VS 2005 though?

Any ideas?

TIA,
Johnny J.

I believe it's mail.IsBodyHtml = true.

When in doubt, check out www.systemnetmail.com ...

Thanks,

Seth Rowe
 
Johnny,

In .NET 2.0, it is recommended to use the System.Net.Mail namespace, instead
of the System.Web.Mail namespace, which is now deprecated.

In the Net.Mail namespace, the MailMessage class has a property called
IsBodyHtml which takes a boolean parameter.
http://msdn2.microsoft.com/en-us/library/system.net.mail.mailmessage.isbodyhtml.aspx

Note: You can also set up multiple views (AlternateViews) to include both
HTML and plain text bodies.
http://msdn2.microsoft.com/en-us/library/system.net.mail.mailmessage.alternateviews.aspx

Hope this helps,


Steve
 
Thanks to both of you - I got it to work (and I DID actually use
System.Net - I only wrote the wrong code in the post...)

Cheers,
Johnny J.
 
Back
Top