I adapted the code from John Savidge

  • Thread starter Andrew Williams
  • Start date
A

Andrew Williams

The following code allowed me to achieve my aim. I adapted
it from John Savidge. Thank you.

<%

If Request.QueryString("isSubmitted") = 1 Then

Dim ContactName, Email, Company, Address1, Address2, City,
County, PostCode,
Country, Tel, Fax, BusinessType,Comments

Dim objCDO

ContactName = Request.QueryString("ContactName")
Email = Request.QueryString("EmailAddress")
Company = Request.QueryString("Company")
Address1 = Request.QueryString("Address1")
Address2 = Request.QueryString("Address2")
City = Request.QueryString("City")
County = Request.QueryString("County")
PostCode = Request.QueryString("PostCode")
Country = Request.QueryString("Country")
Telephone = Request.QueryString("Telephone")
Fax = Request.QueryString("Fax")
BusinessType = Request.QueryString("BusinessType")
Comments = Request.QueryString("Comments")

Set objCDO = Server.CreateObject("CDONTS.NewMail")

objCDO.From = Trim(EmailAddress)

objCDO.To = "(e-mail address removed)"

objCDO.Cc = "(e-mail address removed)"

objCDO.Subject = "Contact From Website at " & Now & " -
Subscribe " &
EmailAddress & "Specification Update"

objCDO.Body = "<html><body>Contact from Website" _
& "<ul><li>Name: " & ContactName & "</li>" _
& "<li>Company: " & Company & "</li>" _
& "<li>Address 1: " & Address1 & "</li>" _
& "<li>Address 2: " & Address2 & "</li>" _
& "<li>City: " & City & "</li>" _
& "<li>County: " & County & "</li>" _
& "<li>Post Code: " & PostCode & "</li>" _
& "<li>Country: " & Country & "</li>" _
& "<li>Email Address: " & EmailAddress & "</li>" _
& "<li>Telephone: " & Telephone & "</li>" _
& "<li>Fax: " & Fax & "</li></ul>" _
& "<p><u>Business Type</u></p>" _
& BusinessType _
& "<p><u>Comments</u></p>" _
& Comments _
& "</body></html>"

objCDO.BodyFormat = 0

objCDO.MailFormat = 0

objCDO.Send

Set objCDO = Nothing

End If

%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top