Link to home
Start Free TrialLog in
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"

%>
ASKER CERTIFIED SOLUTION
Avatar of Big Monty
Big Monty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DDean
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.