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

DDean
DDean used Ask the Experts™
on
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"

%>
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Web Ninja at large
Commented:
you have two lines at the end doing the same thing:

objMail.Send
objMail.Send()

remove either one and you should be good to go

Author

Commented:
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.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial