Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SMTP Sends Mail Twice From ASP

Status
Not open for further replies.

cjircita

MIS
Jan 9, 2002
14
0
0
US
I've written ASP code to send mail using the default SMTP server on a Windows 2000 Server box. My problem is 99.9 percent of the time the mail messages are being sent to each recipient twice. Less than 1 percent of the time a message will get sent only once.

My ASP code is simple (see below). The code gets generated from a subroutine called when the page posts back to itself. The subroutine simply updates a recordset from fields on the form and then runs the mail code below. Has anyone seen this before and perhaps could it be an SMTP problem? If not, could it be that the page is posting back to itself, perhaps running the mail code twice or something?

<%
set objmail = createobject(&quot;cdonts.newmail&quot;)
objmail.from = “me@mymailserver.com”
objmail.to = “them@theirmailserver.com”
objmail.subject = “this is the subject of your email”
num = “1”
ost = &quot;this is the body of the email. Click on this URL&quot;
url = &quot;objmail.body = ost & url & num
objmail.send
set objmail = nothing
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top