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

send an email

Status
Not open for further replies.

casimir

IS-IT--Management
Nov 30, 2002
4
0
0
US
hi,

i m trying to get the email address field value and to send an automatic email at this address. I m using the following code :

<%@ LANGUAGE=&quot;VBSCRIPT&quot;%>
<%email = request.form(&quot;email&quot;)
Dim MyMail
Set MyMail = Server.CreateObject(&quot;CDONTS.NewMail&quot;)
MyMail.From = &quot;justme@myaddress.com&quot;
MyMail.To = &quot; + email + &quot;
MyMail.Cc = &quot;friend3@address3.com;friend4@address4.com&quot;
MyMail.Bcc = &quot;friend5@address5.com;friend6@address6.com&quot;
MyMail.Subject = &quot;sending email via CDONTS NewMail&quot;
MyMail.BodyFormat = 1
MyMail.MailFormat = 0
MyMail.Importance = 2
MyMail.Body = &quot;Sending email with CDONTS NewMail&quot; &_
&quot;objects is easy! Try it!&quot;
MyMail.Attachfile &quot;c:\path\smiley.gif&quot;, &quot;smilefile.gif&quot;, 1
MyMail.Send , &quot;youtoo@youraddress.com&quot;, &quot;new subject&quot;
Set MyMail = Nothing
%>

An error occurs : &quot;echec Server.CreateObject(&quot;CDONTS.NewMail&quot;)&quot;

I m using PWS under WinMe

 
is CDONTS installed on your box??? I know it comes with IIS for sure on an NT or Win2K box (assuming you have the latest service pack), but I would do a search on my hard drive for cdonts.dll -- or maybe it's cdo.dll -- it's one of those two....

If it's not there, then shoot on over to microsoft and pick it up.

And if you would like an unsolicited opinion, go over to and pick up Persits' free email component for ASP. It allows you to specify the SMTP server, which is something you can't do with CDONTS. Free and easy to setup. Personally, I like it better than CDONTS.

:)
Paul Prewett
 
Paul
If CDONTS wasn't installed on casimir's webserver, he would get an OBJECT NOT FOUND error or similar ASP execution failure because the server couldn't process the
&quot;Set MyMail = Server.CreateObject(&quot;CDONTS.NewMail&quot;)&quot;
line. I know because it happened to me on another server.
If casimir isn't getting this error then CDONTS DLL must registered on his server (or the ASP is erroring out before it gets to the line).
Nelson
 
Hi,

this MyMail.To = &quot; + email + &quot; shoud be:
MyMail.To = email

Bye.

 
I'm not sure about ME, but do a search to see what DLL comes up.
The CDONTS is used in NT4 and Win2000 use the new CDO object, so if the only DLL that comes up in your search is the cdo.dll, use the following:

Set MyMail = Server.CreateObject(&quot;CDO.Message&quot;)

I hope it works for you.


NightWatcher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top