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

Need help for CDONTS object. 1

Status
Not open for further replies.

SwapSawe

Programmer
Apr 24, 2001
148
US
Hi all !!!

Why this code won't send me mail.

<%@ Language= VBScript %>

<% Option Explicit %>

<HTML>
<HEAD>

<TITLE></TITLE>
</HEAD>
<BODY>
<%
Dim myMail
Set myMail= Server.CreateObject( &quot;CDONTS.NewMail&quot; )
myMail.From= &quot;swapnils@convergelabs.com&quot;
myMail.To= &quot;manishs@convergelabs.com&quot;
myMail.Subject=&quot;subject&quot;
myMail.BodyFormat = 0
myMail.MailFormat = 0

myMail.Body=&quot;message&quot;
myMail.Send
Set myMail=Nothing
Response.Write&quot;Your mail was sent!&quot;
%>
</BODY>
</HTML>

Thanx in Advance -
Swapnil Sawe.

 
I couldn't find anything wrong with your script so I tested it on my webserver and it work without a problem... I'm guessing you either don't have the CDONTS DLL installed (If your running an XP machine this is most likely the cause. Microsoft stopped including it after Win 2000) or your IIS SMTP isn't setup. Open c:\inetpub\mailroot\queue (or wherever your mailroot directory is) and if there are emails sitting in the queue folder your problem is most likely that IIS isnt connecting to an SMTP server... If this is the case you need an SMTP server address. Once you have aquired this little tidbit of information open IIS. Right click on Default SMTP Virtual Server - Open Properties - Go to the delivery tab - Click on advanced - In the smart host box enter the SMTP address and you should be in business... If this doesn't work there are a couple of other things you could try... Hope this works,
Cheers
Wakestrap
 
SwapSawe

did your script throw up any error?

i guess the problem is that it didnt throw up an error but still didnt send the mail.

if it is so check whether the system that hosts IIS is connected to the net...

Known is handfull, Unknown is worldfull
 
SwapSwawe,

Those of us that took the time to respond, would greatly appreciate hearing if we were able to help or not.

Would be nice to let the group know.

Thanks,
DougCranston
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top