Announcement

Collapse
No announcement yet.

Sending ASP mail CDO.Message

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sending ASP mail CDO.Message

    Hi all,

    I am using a basic ASP/VB script to send an email and I am trying to populate the 'Messagebody' with a mixture of HTML and ASP as follows:

    Messagebody = "Hi "& Request.form("Forename")&", This is a test </br></br>Did it even work?"

    The emails works, but its shows the HTML tags in the output as follows:
    "Hi Gary, This is a test </br></br>Did it even work?"

    Why doesn't it process the tags? It worked this way on a previous hosting package, but since moving it, it doesn't work.

    I'm sure it's something simple!

    Thanks a lot in advance,
    Gary

  • #2
    This is what I use:

    <%
    youremail = "info@yourmail.com"
    yourpassword = "password"
    myCopy = "myemail@address"

    ContactUs_Name = Request("ContactUs_Name")
    ContactUs_Email = Request("ContactUs_Email")
    ContactUs_Body = Request("ContactUs_Body")
    Mail_Action = Request("Mail_Action")

    Dim ObjSendMail
    Set ObjSendMail = CreateObject("CDO.Message")
    ObjSendMail.To = youremail
    ObjSendMail.CC = ContactUs_Email
    ObjSendMail.BCC = myCopy
    ObjSendMail.From = ContactUs_Email

    ' we are sending a html email. Switch comment tag for a text email

    ObjSendMail.HTMLBody = strBody
    'ObjSendMail.TextBody = strBody

    ObjSendMail.Send
    Set ObjSendMail = Nothing
    %>

    Comment

    Working...
    X