Could not access CDO.message

  • Thread starter Thread starter mamatha
  • Start date Start date
M

mamatha

Hi

i have one Email application.When run that application,i
got an error,
"Could not access 'CDO.Message' object."
i have also configure the SMTP,means right click on the
default SMTP server then select the Access tab,after then
choose the Relay button,in that i gave the IP address of
SMTP server and click on ok
then also it will gives the same error
i have reference of cdosys.dll also

can any one help me?


mamatha
 
Mamaths,

I will not say I can help you however for this problems you have to show
some piece of code. (This can be done in thousand ways)

Cor
 
''' set the from address
aMailMessage.From = "(e-mail address removed)"
''' set the to address and subject
aMailMessage.To = "(e-mail address removed)"
aMailMessage.Subject = "This is a test email message."

''' send in Text format
aMailMessage.BodyFormat = System.Web.Mail.MailFormat.Text

''' set the body text (Remember you need to keep your paragraphs
to under 1000 characters)
aMailMessage.Body = "This is the text of the email message."

''' add an attachment if you want to
'aMailMessage.Attachments.Add(New
System.Web.Mail.MailAttachment("C:Test.txt",
System.Web.Mail.MailEncoding.Base64))

''' send the email
' System.Web.Mail.SmtpMail.SmtpServer = "203.124.220.78"



System.Web.Mail.SmtpMail.SmtpServer = "209.25.134.124"
System.Web.Mail.SmtpMail.Send(aMailMessage)
MsgBox("Message has sent")
 
This can be a tough one to debug. The problem is that this error message
gets thrown for a so many reasons that it's almost useless. For example, if
you try to send an email to an email address that has invalid chars like
myemail!@.'aol.com you will get this error message.

I have found that a more helpful error message is sometimes buried two
levels down in the exception object. Once you have caught the exception,
try looking here: myException.InnerException.InnerException.Message. This
may contain a useful message that will point you towards the actual problem.

Hope this helps,

Kevin
 

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