Generating HTML Email Using ASP CDONTS

Results 1 to 3 of 3

Thread: Generating HTML Email Using ASP CDONTS

  1. #1
    Join Date
    Dec 1969

    Default Generating HTML Email Using ASP CDONTS

    Does anyone know of a sure-fire way to generate an HTML email using ASP? I tried generating the HTML in the VBScript code by simply taking the HTML code and placing it inside "Response.Write" commands and sending it using CDONTS. when i receive the message in Outlook, all i see is the raw HTML code and not the page. I want to create this for a client and i don't want to make them use a email service that distributes HTML-based emails. I want to code this myself to empower the client to generate the HTML and send it in a few button click. any advice would be greatly appreciated.

  2. #2
    Join Date
    Dec 1969

    Default CROSS POST

    don't do this, or the bogeyman will get you

  3. #3
    Join Date
    Dec 1969

    Default RE: Generating HTML Email Using ASP CDONTS

    Hi Mark,<BR><BR>You need to tell CDONTs that the email you&#039;re sending is in HTML format. See the function below as an example on how to send email in HTML format. NOTE: one issue I have with this fuction is that when forwarding email via Hotmail, the HTML formatting is lost. I&#039;m currently working on getting an answer to my problem.<BR><BR><BR>function Email (sFrom, sTo, sSubject, sBody)<BR><BR> if sFrom = "" or sTo = "" then<BR> Exit function<BR> end if<BR> <BR> Dim objMail<BR> Set objMail = Server.CreateObject("CDONTS.NewMail")<BR> <BR> objMail.From = sFrom<BR> objMail.Subject = sSubject<BR> <BR> &#039;you need TO add these lines FOR the mail<BR> &#039;to be sent in HTML format<BR> objMail.BodyFormat = 0 <BR> objMail.MailFormat = 0 <BR> <BR> objMail.To = sTo<BR> objMail.Body = sBody<BR> objMail.Send<BR> <BR> set objMail = nothing<BR> <BR>end function<BR><BR>Cheers,<BR>Haniel

Posting Permissions

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