Avatar of DDean
DDean
 asked on

I have a cdonts form I get 2 email but should only get one

I have a form that send a cdonts email used to work but moved it to a different hosting company and now I get 2 email instead of one. I have look for an answer but I cant find a solution for my issue. The code is below. I would appreciate any help.

Thanks

<%@ Language=VBScript %>
<%
Dim name,email,phone,comment,objMail

Email = Request.Form("Email")
Name = Request.Form("Name")
Phone = Request.Form("Phone")
Comments = Request.Form("Comments")
ContactBy = Request.Form("ContactBy")
DateSent = Date()


sBody = "Today is: " & DateSent
sBody = sBody & vbCrLf & "============================================"
sBody = sBody & vbCrLf & "My name is: " & Name
sBody = sBody & vbCrLf & "My phone number is: " & Phone
sBody = sBody & vbCrLf & "My email Is: " & Email
sBody = sBody & vbCrLf & vbCrLf & "Here is my Question / Comment: "
sBody = sBody & vbCrLf & Comments
sBody = sBody & vbCrLf& vbCrLf & "I prefer to be contacted " & ContactBy

Set objMail = CreateObject("CDO.Message")

objMail.From = Request.Form("Email")
objMail.Subject = "Question/Comment from GVMC Website"
objMail.TextBody = sBody

objMail.To = "dgd@abctools.com"
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="mail.bc-alter.net"
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
'Authentication
objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "dgd@abctools.com"
objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "so what"
objMail.Configuration.Fields.Update
objMail.Send
objMail.Send()
Set objMail = Nothing
Response.Redirect "commentthanks.php"

%>
Web DevelopmentASP

Avatar of undefined
Last Comment
DDean

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Big Monty

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
DDean

ASKER
Thanks Big Monty .. I looked at the code last night for a couple of hours and didn't see that. It works great and now I can close this project.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes