Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Send ASP email using CDOSYS with HTML body which merges both form fields and DB fields

Avatar of it4business
it4business asked on
5 Comments1 Solution925 ViewsLast Modified:
I am having a problem with an ASP form. We use the form to send emails to clients through our support intranet. The form has a few fields and when it is submitted it should send an email to the client and copy us in as well as adding the form fields to the support intranet database.

It all works fine but now we want to merge a field from the database with the email body before it is sent.

I dont know how to pull these database fields in to the code for the email. Can anyone assist?

The field I am trying to add on to the end of the HTML email body is:
The recordset is called Users and the field is called HTMLSignature

Just to say that the code works fine EXCEPT for that i can't merge the contents of the HTMLSignature field with the emailBody variable....

the error i get is:

Microsoft VBScript runtime error '800a01a8'

Object required: ''

/add_incident_email_send.asp, line 73

Line 73 is the line starting emailBody=
emailSubject = "Support Incident: " &  Request.Form("IncidentID") & " - " & Request.Form("IncidentTitle")
emailTo = Request.Form("emailTo")
emailBody = Request.Form("ActionDetail") & Users.Fields.Item("HTMLSignature").Value
Set objMessage = CreateObject("CDO.Message") 
objMessage.Subject = emailSubject
objMessage.From = "Support @ Our Company<support@ourcompany.com>" 
objMessage.To = emailTo
objMessage.HTMLBody = emailBody
Avatar of Wayne Barron
Wayne BarronFlag of United States of America imageAuthor, Web Developer
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answers