Saturday, March 24, 2012

HTML Email

How do I send HTML email with the System.Web.Mail namespace?
I tried to put <HTML><HEAD></HEAD><BODY><b>Test</b></BODY></HTML>
in the body of the email, but it didn't work. MY html tags became text.
What can I do?Hi,
You need to set the
Mail.BodyFormat = MailFormat.Html
(Assuming Mail is the name of your mail object).
Best regards,
Dave Colliver.
http://www.ManchesterFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Arne" <Arne@.discussions.microsoft.com> wrote in message
news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
> How do I send HTML email with the System.Web.Mail namespace?
> I tried to put <HTML><HEAD></HEAD><BODY><b>Test</b></BODY></HTML>
> in the body of the email, but it didn't work. MY html tags became text.
> What can I do?
>You need to set the
>Mail.BodyFormat = MailFormat.Html
Do you know if it can handle multi-part e-mails? What I mean is ones
sent in both plain text and HTML. That way, the e-mail client being used
can display whichever it feels (or the user has specified).
Thanks.

>(Assuming Mail is the name of your mail object).
>Best regards,
>Dave Colliver.
>http://www.ManchesterFOCUS.com
>~~
>http://www.FOCUSPortals.com - Local franchises available
>
>"Arne" <Arne@.discussions.microsoft.com> wrote in message
>news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
>
Alan Silver
(anything added below this line is nothing to do with me)
Yes it does.
"Alan Silver" wrote:

> Do you know if it can handle multi-part e-mails? What I mean is ones
> sent in both plain text and HTML. That way, the e-mail client being used
> can display whichever it feels (or the user has specified).
> Thanks.
>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
>
>Yes it does.
OK, maybe I should have been a bit more specific with my question!!
*How* do you do these types of e-mails? I couldn't see anything in the
SDK - which doesn't mean it's not there, just that I couldn't find it.
TIA
>"Alan Silver" wrote:
>
Alan Silver
(anything added below this line is nothing to do with me)
Mail.BodyFormat = MailFormat.Html
will send both text and HTML format in the same format.
No, the documentation will not tell you everything you need to know about
email.
"Alan Silver" wrote:

> OK, maybe I should have been a bit more specific with my question!!
> *How* do you do these types of e-mails? I couldn't see anything in the
> SDK - which doesn't mean it's not there, just that I couldn't find it.
> TIA
>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
>
>Mail.BodyFormat = MailFormat.Html
>will send both text and HTML format in the same format.
Thanks. How do I set the two body texts? I would want a plain text one
and an HTML one. AFAICS, there is only the one Body property, which
presumably uses the MailFormat property to decide how to display the
contents. I can't see how you do multi-part messages.
Thanks
>No, the documentation will not tell you everything you need to know about
>email.
>"Alan Silver" wrote:
>
Alan Silver
(anything added below this line is nothing to do with me)

No comments:

Post a Comment