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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDONTS

Status
Not open for further replies.

NevG

Programmer
Oct 10, 2000
162
GB
Hi

I am using the CDONTS.NewMail object to send a mail to a client with a dynamic reference number established from a SQL server dbase. This is fine and on my local machine this works fine

When I try to run the asp page fromthe server it tells me it has sent the mail but it doesnt actualy deliver.

The server is running MS Proxy server and so we all collect our mail this way.

Could this lack of mail delivery be something to do with proxy or should I add code to my asp page to indicate something else.

Here is my ASP code. I have changed th sql strings for security reasons only but the rest is the same.

<HTML>

<BODY>

<%

Set Message = CreateObject(&quot;CDONTS.NewMail&quot;)
set cap = createobject(&quot;MyObj.MyClass&quot;)
set rs=createobject(&quot;ADODB.recordset&quot;)
set rsNo = createobject(&quot;ADODB.recordset&quot;)

sql = &quot;SQL STRING&quot;

set rs = cap.GetRecordset(sql)

Message.From = &quot;webmaster@capital-fusion.com&quot;
rs.MoveFirst
Message.To = rs.fields(0)'Request.Form(&quot;email&quot;)
Message.Subject = &quot;Request Log&quot;

sql = SQL STRING
set rsNo = cap.GetRecordset (sql)


BodyToSend = &quot;Your request No is: &quot; & rsNo.fields(0) & vbcrlf & _
&quot; &quot; & vbCRLF & _
&quot;Please Quote this number during any contact with Capital Fusion&quot; _
& vbcrlf & _
&quot; &quot; & vbCRLF & _

&quot;***Auto Response From dfhdfhfdfhdfh***&quot;

Message.Body = BodyToSend

On Error Resume Next

Message.Send

If Err.Number = 0 Then
Response.Write &quot;An E-mail has been sent to you containing your Request Log Ref No.&quot;
Else
Response.Write &quot;Error: &quot; & Err.Description
End If

rs.Close
rsNo.Close

set rs = nothing
set rsNo = nothing
Set Message = Nothing

%>
</BODY>

</HTML>

Please help

Nev G
 
Make sure you have cdonts dll registered and install the SMTP service from the NT Option Pack (Installs under IIS). Just a couple suggestions.
 
This sounds like SMTP might not be running. If you check your &quot;BadMail&quot; directory...are there any messages there? Or maybe in the &quot;MailQueue&quot; directory in IIS?

IIS is actually 'sending' the mail, but only in the sense like with a mail client...putting it in an outbox of sorts.

Just a simple fix...check if your IIS's SMTP service is running
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top