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!

Sending E-Mails with CDO.MailMessage 1

Status
Not open for further replies.

jfrost10

Programmer
Jun 3, 2001
2,004
CA
I'm trying to send an email message using CDO.MailMessage object. Our web server is based on win2k, and is running the SMTP virtual machine. For some reason though, its not working (getting weird errors in InterDev). If anyone has any experience getting this up and running, please let me know! One of those "needed it last week" kinda things.
;)

Thanks guys,

J
 
I've had similar problems using CDONTS in Win2K...more often than not, just verify that the SMTP service is in fact running and that CDONTS has been registered for IIS 5.0, at c:\WINNT\system32\cdonts.dll

Also, here's the generic syntax for a CDONTS.NewMail message:
========================== EMAIL.ASP =====================
<%
' DECLARE VARIABLES AND INSTANTIATE THE newmail OBJECT
Dim objMailMessage
Set objMailMessage = Server.CreateObject(&quot;CDONTS.NewMail&quot;)

' FORMAT THE newmail MESSAGE
objMailMessage.to = &quot;recipient@domain.com&quot;
objMailMessage.from = &quot;sender@domain.com&quot;
objMailMessage.cc = &quot;someone@domain.com&quot;
objMailMessage.bcc = &quot;someoneelse@domain.com&quot;
objMailMessage.subject = Testing CDONTS
objMailMessage.bodyformat = 0 ' 0 for HTML, 1 for plaintext (default)
objMailMessage.body = &quot;<h1>This is an APB for you...<font face=Verdana color=#005522>CDONTS.NewMail</font> has been installed and is working fine. You'll thank me later.</h1><h3>Love,<br><a href='mailto:sender@domain.com'>Your friend</a></h3>&quot;
objMailMessage.Importance = 2

' SEND THE MAIL MESSAGE TO ITS RECIPIENTS
objMailMessage.Send()`

' DEREFERNCE THE OBJECT AND DESTROY ITS INSTANCE
Set objMailMessage = Nothing
%>
======================================================

If this doesn't work...then what error message are you getting?
 
Hey Jason, thanks for the reply!
:)

Well here's the wanky thing: I'm not getting any error message with the CDONTS, but I'm just not getting any of the emails it should have sent from my testing (and I double checked the email addey in the code and that smtp is running). I am testing this from a local machine, so I'm not sure if that makes a difference, and we're behind a firewall creted by our router (although i don't think that would change anything).

Thanks again,

J
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top