Combining message.BodyFormat = MailFormat.Html & message.BodyFormat = MailFormat.Text

Discussion in 'ASP .Net' started by =?Utf-8?B?bWc=?=, Feb 8, 2004.

  1. I'd like to send a single e-mail message message that uses the escape character \n as well as the html tag <i> in the body

    How can I combine the two parts of this merssage

    message.BodyFormat = MailFormat.Text
    String msgTextA = "\n\nFrom: Carol Johnson\n\nSent: Monday, February 9, 2004

    message.BodyFormat = MailFormat.Html
    String msgTextB = "<i> Inventory Control <i>

    ????? message.Body = msgText; ??????

    SmtpMail.Send(message);
     
    =?Utf-8?B?bWc=?=, Feb 8, 2004
    #1
    1. Advertising

  2. Hi,
    The System.Web.Mail part does not support sending more than one body
    format for an email message.
    You can use either MailFormat.Text or MailFormat.Html.
    I think in your case if you just want to have line breaks,you can use
    MailFormat.Html for your whole email body.
    message.BodyFormat = MailFormat.Html;
    String msgTextA = "<br><br>From: Carol Johnson<br><br>Sent: Monday,
    February 9, 2004" ;// to convert to html way

    Unfortunately the System.Web.Mail class does not allow you
    to send an HTML message with support for non
    HTML readers.
    If you really want to support non HTML readers you will
    need to look for some third party.
    Here is a link :
    http://www.quiksoft.com/newsletter/issue002/default.asp?page=1
    Hope this helps.
    Regards,
    Marshal Antony
    ..NET Developer
    http://www.dotnetmarshal.com




    "mg" <> wrote in message
    news:...
    > I'd like to send a single e-mail message message that uses the escape

    character \n as well as the html tag <i> in the body.
    >
    > How can I combine the two parts of this merssage?
    >
    > message.BodyFormat = MailFormat.Text;
    > String msgTextA = "\n\nFrom: Carol Johnson\n\nSent: Monday, February 9,

    2004"
    >
    > message.BodyFormat = MailFormat.Html;
    > String msgTextB = "<i> Inventory Control <i>"
    >
    > ????? message.Body = msgText; ??????
    >
    > SmtpMail.Send(message);
     
    Marshal Antony, Feb 8, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Aren Cambre
    Replies:
    5
    Views:
    4,103
  2. =?Utf-8?B?TWVoZGk=?=

    email bodyformat

    =?Utf-8?B?TWVoZGk=?=, Jun 18, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    460
    =?Utf-8?B?TWVoZGk=?=
    Jun 18, 2005
  3. =?Utf-8?B?Unlhbg==?=
    Replies:
    2
    Views:
    3,905
    Steven Cheng[MSFT]
    Feb 28, 2006
  4. ChrisA
    Replies:
    2
    Views:
    3,049
    ChrisA
    May 6, 2006
  5. Rod
    Replies:
    2
    Views:
    370
    John Prado
    Jun 29, 2006
Loading...

Share This Page