Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Email Form Troubles

Status
Not open for further replies.

DanT07

Programmer
May 11, 2005
38
GB
Hi all,

I have an email form which is then processed using the script below. This works fine but I also receive 2 extra blank emails each time along with the correct email. Does anyone know a possible cause for this?

<%
Dim strName
Dim strTel1
Dim strTel2
Dim strEmail
Dim strEnquiry
Dim emailtxt
Dim CDONTSMail

strName = Request.Form.Item("name")
strTel1 = Request.Form.Item("dayphone")
strTel2 = Request.Form.Item("evephone")
strEmail = Request.Form.Item("email")
strEnquiry = Request.Form.Item("enquiry")

Set CDONTSMail = Server.CreateObject("CDONTS.NewMail")
CDONTSMail.From = "user@host.com"
CDONTSMail.To = "user@host.com"
CDONTSMail.Subject = "Online Enquiry"

emailtxt = "Name : " & strName & vbCrLf _
& "Daytime Tel : " & strTel1 & vbCrLf _
& "Evening Tel : " & strTel2 & vbCrLf _
& "Email Address : " & strEmail & vbCrLf & vbCrLf _
& "Enquiry : " & vbCrLf & strEnquiry

CDONTSMail.Body = emailtxt
CDONTSMail.BodyFormat = 1
CDONTSMail.MailFormat = 0
CDONTSMail.Send
set CDONTSMail = nothing

%>

Thanks very much,

Dan
 
May we view the script that is posting to this? It may be a form issue
 
Is it possible that there is a Response.Redirect somewhere else either on this page or on another that is causing the page ro execute multiple times?
 
I can not see anything. I have used Find in entire local site and it does not find anything like that. Its very strange indeed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top