How to send mail in HTML format

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default How to send mail in HTML format

    How do I format a message so it shows up as a web page in the mail reader.
    In the body of my message, I'm including a '<!DOCTYPE HTML PUBLIC
    "-//W3C//DTD HTML 4.0 Traditional//EN">' tag and standard <html><body> tags
    but this all shows up as text in the message. What's the secret?

    --
    Paul Turley, MCSD, MCAD, MCT, MSF Practitioner, A+ Technician
    [email]paul@createsolutions.net[/email]



    Paul Turley Guest

  2. Similar Questions and Discussions

    1. Mail:Sender - HTML Mail with alternatives problem
      I'm trying to generate an HTML mail with text alternatives using the mail:sender module. As everybody can see below the message was created and...
    2. Published html to send by e-mail
      I created a Newsletter (containing various text boxes, pictures and titles) on Publisher, then in outlook I selected New Mail message, open and...
    3. the script hangs up when i try to send mail with attachments using MAIL::Sender...???
      As said in the topic... when i try to send an e-mail message using Mail::Sender the script hangs up before execution of $sender ->...
    4. Can't send/receive Mail (Apple Mail)
      Somehow, I can't send or receive any E-mails... I'm using apple mail and tried with entourage, too... I also checked user name, password..etc...
    5. Send Same E-mail To Multiple E-mail Addresses?
      "Ralph Swanson" <r.swanson@sbcglobal.net> wrote: You need one. First add all the Addresses to your Address Book, then go File > New Group and...
  3. #2

    Default Re: How to send mail in HTML format

    On Sun, 27 Jul 2003 20:06:04 -0700, "Paul Turley"
    <paul@createsolutions.net> wrote:
    >I can't get the SmtpMail object to work on our ISP's production server so
    >I'm stuck with using CDONTS in an ASP page. My code looks like this:
    >
    >Set msg = CreateObject("CDONTS.NewMail")
    >msg.From = ...
    >...
    >msg.BodyFormat = 0 '-- This is the value of cdoBodyFormatHTML
    >msg.Body = ...
    >msg.Send()
    >
    >
    ><If there is a more appropriate group to post this to, please let me know.
    >I can't find a group for CDO>
    Does your ISP support ASP.NET? Is the web page in question a ASP page
    or a ASP.NET page. If ASP.NET, mail functions are exposed via a
    different method than CDONTS or CDO.

    I suspect you are using ASP not ASP.NET? If so, and if your ISP uses
    Win2k or better, use CDO via ASP, not CDONTS. If you want to use CDO
    as I suggest, check out the MSDN library URL:

    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdosys/html/_cdosys_about_cdo_for_windows_2000.asp?frame=true[/url]

    For a short answer, if I recall correctly CDONTS will send the message
    as HTML if you load up the property

    msg.HTMLText=strText ' the var that holds your HTML

    instead of

    msg.Text=strText

    Dan Bush
    [email]me@REMOVE.danbush.com[/email]
    Daniel Bush Guest

  4. #3

    Default RE: How to send mail in HTML format

    Hello,

    I suggest you use the following code:

    Dim iMsg
    Dim iConf

    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")

    Dim Flds
    Set Flds = iConf.Fields

    With Flds
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
    "SMARTHOST"
    .Update()
    End With

    With iMsg
    .Configuration = iConf
    .To = "<aaa@microsoft.com>"
    .From = "<bbb@microsoft.com>"
    .Subject = "hello"
    .HTMLBody = "<html><b>Hello</b></html>"
    .Send()
    End With

    --
    Parker Zhang
    Microsoft Developer Support

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Parker Zhang [MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139