CDO.Message

  • Thread starter Thread starter Eduard
  • Start date Start date
E

Eduard

When sending mail I get the classic 'Cannot access CDO.Message object'
exception. I remember I solved this problem once before, but cannot remember
how :-)

I'm sending mail using an existing from address, an existing to address, and
SmtpMail.SmtpServer DOES exist. strange strange strange... anyone??
 
Here is the Code that causes the 'Cannot access CDO.Message object'
The x's replace my parameters
-----------------------------------------------------------------------------------------------------------------
Dim mail As New System.Web.Mail.MailMessage
mail.To = "(e-mail address removed)"
mail.From = "(e-mail address removed)"
mail.Subject = "this is a test email."
mail.Body = "Some text goes here"

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1") 'basic authentication

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"xxxxx") 'set your username here

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"xxxxxx") 'set your password here
System.Web.Mail.SmtpMail.SmtpServer = "xx.xx.xx.xx" 'your real
server goes here
System.Web.Mail.SmtpMail.Send(mail)
-----------------------
I have the following imports:

Imports System.Web
Imports System.Web.Mail.MailMessage


Your comments

Thanks

Joe
 

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

Back
Top