SmtpMail.Send - "Could Not Access CDO.Message Object"

C

chuckdfoster

I am getting a "Could Not Access CDO.Message Object" Error when I try to use
the following code to send an email via ASP.NET. When I run this on one
machine it works, on another one it doesn't. Both have VS.NET installed and
both have MS Outlook installed. What do I need done to the machine that
doesn't work? Or is something wrong with the code?

Dim email as New System.Web.Mail.Message
email.To = "(e-mail address removed)"
email.Subject = "Test Subject"
email.Body = "Test Body"
System.Web.Mail.SmtpMail.SmtpServer = "MyMailServer"
Try
System.Web.Mail.SmtpMail.Send(email)
Catch ex as Exception
lblError.Text = ex.Message
End Try

Thanks in advance!
 
J

Jason Bentley

Chuck, first make sure that CDO is installed on the server. Second, you
need to write out the inner exceptions. This error message is a generic
message and can be caused by an invalid SmtpServer address, an invalid
or missing addressee, an invalid from address, or a lack of privileges
on the Smtp Server among others.

Jason Bentley
http://geekswithblogs.net/jbentley
 
C

chuckdfoster

Thanks! I didn't have a valid from address. Matter of fact, I forgot it!
Thanks for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top