| | |
Form sends email for every page load
Please support our ASP advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Jun 2009
Posts: 2
Reputation:
Solved Threads: 0
Hi, I built a form to send customer info and used some ASP I found on the internet so I'm quite new to it. I got it to send the info I want but I recieve an e-mail every time I navigate away from the page not using the submit button. Here's the ASP I'm using to do it with:
Does anyone have any ideas?
Cheers.
ASP Syntax (Toggle Plain Text)
Dim objConfig ' As CDO.Configuration Dim objMessage ' As CDO.Message Dim Fields ' As ADODB.Fields Dim title, firstname, surname, email, confirmemail, reason, other, enquiry title = Request.Form("title") firstname = Request.Form("firstname") surname = Request.Form("surname") email = Request.Form("email") confirmemail = Request.Form("confirmemail") reason = Request.Form("reason") other = Request.Form("other") enquiry = Request.Form("enquiry") ' Get a handle on the config object and it's fields Set objConfig = Server.CreateObject("CDO.Configuration") Set Fields = objConfig.Fields ' Set config fields we care about With Fields .Item(cdoSendUsingMethod) = cdoSendUsingPort .Item(cdoSMTPServer) = "smtp.somesite.co.uk" .Item(cdoSMTPServerPort) = 25 .Item(cdoSMTPConnectionTimeout) = 10 .Item(cdoSMTPAuthenticate) = cdoBasic .Item(cdoSendUserName) = "me@somesite.co.uk" .Item(cdoSendPassword) = "password" .Update End With Set objMessage = Server.CreateObject("CDO.Message") Set objMessage.Configuration = objConfig With objMessage .To = "someone@something.com" .From = "someone@something.co.uk" .Subject = "Customer Enquiry" .TextBody = "SMTP Relay Test Sent @ " & Now() & vbCrLf & "title: " & title & vbCrLf & "firstname: " & firstname & vbCrLf & "surname: " & surname & vbCrLf & "email: " & email & vbCrLf & "confirmemail: " & confirmemail & vbCrLf & "reason: " & reason & vbCrLf & "other: " & other & vbCrLf & "enquiry: " & enquiry .Send End With Set Fields = Nothing Set objMessage = Nothing Set objConfig = Nothing %>
Does anyone have any ideas?
Cheers.
![]() |
Similar Threads
- Outlook Outbox sends email but does not move mail to Sent Items (Windows Software)
- Need Help Making a Form send to an email using PHP (PHP)
- dynamic form filling (PHP)
- Send form inputs to email address (PHP)
- Hotmail "page cannot load" (Web Browsers)
- creating the text file that a form sends to email (HTML and CSS)
- Form not sending email (PHP)
Other Threads in the ASP Forum
- Previous Thread: Sending an Automatic Email
- Next Thread: CDOSYS problems
| Thread Tools | Search this Thread |
archive asp aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection





