473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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

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")
= "we*******@thedomain.com"
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

Jan 2 '06 #1
3 1543
What if you double click the form button ? Could it be that the user just
clicks multiple times on the button ?

--
Patrice

"Chris Baker" <ch**********@gmail.com> a écrit dans le message de
news:11**********************@g49g2000cwa.googlegr oups.com...
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/smtpauthe
nticate") = 1
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusern
ame") = "we*******@thedomain.com"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassw
ord") = "xxxxxxxx"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserve
r") = "mail.thedomain.com"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserve
rport") = 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing
") = 2
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconne
ctiontimeout") = 60
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusess
l") = 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

Jan 3 '06 #2
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.

Jan 3 '06 #3
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.

--
Patrice

"Chris Baker" <ch**********@gmail.com> a écrit dans le message de
news:11*********************@g49g2000cwa.googlegro ups.com...
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.

Jan 3 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Greg T | last post by:
Hi, I have a rather long form that I don't want people submitting unless they are absolutely sure they are ready. I figured the easiest way to prevent an accidental form submission by way of...
5
by: Don | last post by:
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is there some way, using JavaScript, to setup a <form> tag to do this? Thanks, Don ----==...
5
by: Tyler Style | last post by:
Hullo - looking for a little advice here. I have a form on a page in one domain submitting to a cgi in another domain. Weirdly, on some Windows XP systems, a form on the page fails to submit/post...
2
by: MickG | last post by:
I think that this should be reasonably easy but it is proving to be hugely difficult. I am wanting to reset the form to all the original values when I submit the form. Here is the select box...
6
by: Joe | last post by:
Hi, I have a MS Access DB in which a record has just too many fields to be able to allow users to do inline editing in a datagrid. So I want to display as First Name: Text box where first...
0
by: Marc DVer | last post by:
I am at kind of a loss on how to design a certain database project I am working on. Basically, we have a proprietary program with a standard backend (though we do not have direct write access to...
3
by: TomH | last post by:
I am using VB within VS 2005. How can I have multiple datagridviews on the same form pulling from the same table? e.g. I want to see all clients from New York in one view and all clients from LA in...
1
by: daney200334 | last post by:
Regards! pleaseeeeeeeeeeee someone help me with thi hell, im almost disopinted, is there anyone else HACKERSPK who can do this? i have a form that sends messages, its made by my friend but he has...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
2
by: vikasbatra | last post by:
i m submitting (posting) a form to some external site url . By clicking on submit it opens up new window (target='_blank' set) and my form is submitted there. but if i tries to submit a form using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.