No announcement yet.

Sending ASP mail CDO.Message

  • 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,

  • #2
    This is what I use:

    youremail = ""
    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

    Set ObjSendMail = Nothing



    Fatal error: Uncaught exception 'Exception' with message 'MySQL server has gone away' in /data/built2go/hf_home/webm/public_html/htmlforums/vb/core/vb/db/query/update.php:120 Stack trace: #0 /data/built2go/hf_home/webm/public_html/htmlforums/vb/core/vb/db/query/update.php(101): vB_dB_Query_Update->doUpdates() #1 /data/built2go/hf_home/webm/public_html/htmlforums/vb/core/vb/db/assertor.php(283): vB_dB_Query_Update->execSQL() #2 /data/built2go/hf_home/webm/public_html/htmlforums/vb/core/vb/db/assertor.php(518): vB_dB_Assertor->assertQuery('session', Array) #3 /data/built2go/hf_home/webm/public_html/htmlforums/vb/core/vb/session.php(520): vB_dB_Assertor->update('session', Array, Array) #4 /data/built2go/hf_home/webm/public_html/htmlforums/vb/core/vb/library/user.php(911): vB_Session->save() #5 /data/built2go/hf_home/webm/public_html/htmlforums/vb/core/vb/mail.php(437): vB_Library_User->updateEmailFloodTime() #6 /data/built2go/hf_home/webm/public_html/htmlforums/vb/core/vb/mail.php(131): vB_Mail->send() #7 /data/built2go/hf_h in /data/built2go/hf_home/webm/public_html/htmlforums/vb/core/vb/db/query/update.php on line 120