PDA

View Full Version : CDO sends duplicate emails


rrhandle
09-21-2004, 04:16 AM
Can anyone tell me why the code below sends 3 copies of the same email???


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
<META NAME="Generator" CONTENT="TextPad 4.6">
<META NAME="Author" CONTENT="?">
<META NAME="Keywords" CONTENT="?">
<META NAME="Description" CONTENT="?">
</HEAD>
<%


set MyMail = createobject("cdo.message")
set objConfig = createobject("cdo.configuration")

' Setting the SMTP Server
Set Flds = objConfig.Fields
Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
Flds.update

Set MyMail.Configuration = objConfig
MyMail.To = "rhandler@robinhandler.com"
MyMail.From = "Postmaster@nomax.net"
MyMail.Subject = "stxcvbrSubject"
MyMail.TextBody = "strBoxcvbxcvbdy"
MyMail.fields.update
MyMail.Send

set MyMail = nothing
set objConfig = nothing


%>

[b]



</BODY>
</HTML>

bruce
09-21-2004, 06:53 AM
I tested the same code (sending to another email address), I didn't get any dups

[b]quote:Originally posted by rrhandle

Can anyone tell me why the code below sends 3 copies of the same email???


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
<META NAME="Generator" CONTENT="TextPad 4.6">
<META NAME="Author" CONTENT="?">
<META NAME="Keywords" CONTENT="?">
<META NAME="Description" CONTENT="?">
</HEAD>
<%


set MyMail = createobject("cdo.message")
set objConfig = createobject("cdo.configuration")

' Setting the SMTP Server
Set Flds = objConfig.Fields
Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
Flds.update

Set MyMail.Configuration = objConfig
MyMail.To = "rhandler@robinhandler.com"
MyMail.From = "Postmaster@nomax.net"
MyMail.Subject = "stxcvbrSubject"
MyMail.TextBody = "strBoxcvbxcvbdy"
MyMail.fields.update
MyMail.Send

set MyMail = nothing
set objConfig = nothing


%>

[b]



</BODY>
</HTML>
</blockquote id="quote"></font id="quote">

B.

DiscountASP.NET
http://www.DiscountASP.NET