submitting form once results in multiple e-mails received...sometimes

C

Chris Baker

This is a problem I have been troubleshooting for about 4-6 months. I
have an e-mail form on a client's public website that is mis-behaving.
It is written in ASP and uses a CDO.Message object. there is only one
call to the Send method. The problem occurs with and also without a
CDO.Configuration set to the Message.

When I test the form from my computer, it acts normally, sending only
one message, and I receive only one message; however, when I send the
form from my client's office (his computer), 2 to 3 message are
received. The Message-IDs are different. The form writes unique
date/time information to a file each time a message is sent, so I know
that the code is being executed multiple times.

This appears to be a problem with either his network or his computer,
but I don't know where to start. The code works fine, but I'll paste
it in anyway. Any thoughts would be appreciated!

<code>
' The values passed into this function should be validated already.
function SendMail(varTo, varFrom, varSubject, varBody)
Dim objCDOMail, oMailConfig
Set objCDOMail = CreateObject("CDO.Message")
Set oMailConfig = Server.CreateObject("CDO.Configuration")
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")
= 1
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername")
= "(e-mail address removed)"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword")
= "xxxxxxxx"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "mail.thedomain.com"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")
= 2
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 60
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl")
= False
oMailConfig.Fields.Update
Set objCDOMail.Configuration = oMailConfig
objCDOMail.From = varFrom
objCDOMail.To = varTo
objCDOMail.Subject = varSubject
objCDOMail.HtmlBody = varBody
objCDOMail.Send
writeBackup()
boolInquirySent = True
Set oMailConfig = Nothing
Set objCDOMail = Nothing
end Function
</code>

thanks,
--Chris Baker
 
P

Patrice

What if you double click the form button ? Could it be that the user just
clicks multiple times on the button ?
 
C

Chris Baker

No. I was the one testing the form on his machine and I only clicked
once. There is a client-side script that would prevent a second click.
 
P

Patrice

Other options :
- you could check the IIS log to see if you have a single request (the guy
that have the problem could have disabled client scripting ?)

You could also perhaps thave this guy describing exactly what he is doing as
it seems specific to this guy and /or his machine...

If you are 100% sure that the page is run once, you could likely add some
kind of trace in a session variable to make sure you don't have some kind of
logic error that makes your main code send several mails instead of one.

Finally it could be perhaps that the same mail is send multiple times to the
user (duplicate values in the To field or something like that ?).

Good luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top