Home All Groups Group Topic Archive Search About

Converting from System.Web.Mail to System.Net.Mail

Author
12 Dec 2006 7:39 AM
Nathan Sokalski
I am moving an application that involves sending email from 1.1 to 2.0. I am
attempting to convert the email-sending code from System.Web.Mail to
System.Net.Mail. I think I have most of this accomplished, but I am trying
to find the System.Net.Mail equivelant of
System.Web.Mail.MailMessage.BodyFormat. In the past, I used code such as the
following to specify whether the message was html or text:

mymessage.BodyFormat = Mail.MailFormat.Html

However, I cannot find a property of the System.Net.Mail.MailMessage class
that specifies this. What do I do to specify html or text? Thanks.
--
Nathan Sokalski
njsokal***@hotmail.com
http://www.nathansokalski.com/

Author
12 Dec 2006 7:59 AM
Jacob
I think you're supposed to use myMessage.IsBodyHtml = true;

Nathan Sokalski wrote:
Show quote
> I am moving an application that involves sending email from 1.1 to 2.0. I am
> attempting to convert the email-sending code from System.Web.Mail to
> System.Net.Mail. I think I have most of this accomplished, but I am trying
> to find the System.Net.Mail equivelant of
> System.Web.Mail.MailMessage.BodyFormat. In the past, I used code such as the
> following to specify whether the message was html or text:
>
> mymessage.BodyFormat = Mail.MailFormat.Html
>
> However, I cannot find a property of the System.Net.Mail.MailMessage class
> that specifies this. What do I do to specify html or text? Thanks.
> --
> Nathan Sokalski
> njsokal***@hotmail.com
> http://www.nathansokalski.com/

AddThis Social Bookmark Button