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
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