By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,696 Members | 1,222 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,696 IT Pros & Developers. It's quick & easy.

Send Mail VB.Net Error Message

P: n/a
I have a VB.Net service that I'm trying to send e-mail from. Below is my
code:

Dim MessageProcessing As New SageQuestMailer

SendMailMessage(EmailAddresses)

Function SendMailMessage(ByVal EmailAddresses)

Dim ToAddress As String = "lb***@sage-quest.com"
Dim FromAddress As String = "SageQuest Alert Processor"
Dim Subject As String = "Alert Message"
Dim TextMessage As String = "This is a Canned Alert for Testing"

MessageProcessing.SendMail(ToAddress, FromAddress, Subject,
TextMessage)
End Function

Public Class SageQuestMailer
Inherits System.ComponentModel.Component

Public Function SendMail(ByVal ToAddress, ByVal FromAddress, ByVal
Subject, ByVal TextMessage)
Try

Dim MailMessage As MailMessage = New MailMessage
Dim OutboundSMTP As SmtpMail

OutboundSMTP.SmtpServer = "sage-quest.com"
MailMessage.To = ToAddress
MailMessage.From = FromAddress
MailMessage.Subject = Subject
MailMessage.Body = TextMessage

OutboundSMTP.Send(MailMessage)

Catch ex As Exception

End Try
End Function

When I execute the above function I get the following exception:

Could Not Access 'CDO.Message' object.

What am I missing here? I've added the "COM" refrences to my project and
also "ActiveX Data objects" as well.

Nothing seems to help here. Again What am I missing here.
Thanks
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I do have the imports for mail please see below:
Imports System.Web.Mail
"Larry Bird" wrote:
I have a VB.Net service that I'm trying to send e-mail from. Below is my
code:

Dim MessageProcessing As New SageQuestMailer

SendMailMessage(EmailAddresses)

Function SendMailMessage(ByVal EmailAddresses)

Dim ToAddress As String = "lb***@sage-quest.com"
Dim FromAddress As String = "SageQuest Alert Processor"
Dim Subject As String = "Alert Message"
Dim TextMessage As String = "This is a Canned Alert for Testing"

MessageProcessing.SendMail(ToAddress, FromAddress, Subject,
TextMessage)
End Function

Public Class SageQuestMailer
Inherits System.ComponentModel.Component

Public Function SendMail(ByVal ToAddress, ByVal FromAddress, ByVal
Subject, ByVal TextMessage)
Try

Dim MailMessage As MailMessage = New MailMessage
Dim OutboundSMTP As SmtpMail

OutboundSMTP.SmtpServer = "sage-quest.com"
MailMessage.To = ToAddress
MailMessage.From = FromAddress
MailMessage.Subject = Subject
MailMessage.Body = TextMessage

OutboundSMTP.Send(MailMessage)

Catch ex As Exception

End Try
End Function

When I execute the above function I get the following exception:

Could Not Access 'CDO.Message' object.

What am I missing here? I've added the "COM" refrences to my project and
also "ActiveX Data objects" as well.

Nothing seems to help here. Again What am I missing here.
Thanks

Nov 21 '05 #2

P: n/a
Larry,
It sounds like you don't have CDONTS or CDOSYS installed on your computer.
CDONTS & CDOSYS are OS dependant.

The following site provides a wealth of information on System.Web.Mail.

http://www.systemwebmail.net/

Topic 4.2.3 starts discussing your message.
http://www.systemwebmail.net/faq/4.2.3.aspx

Hope this helps
Jay

"Larry Bird" <La*******@discussions.microsoft.com> wrote in message
news:0B**********************************@microsof t.com...
I have a VB.Net service that I'm trying to send e-mail from. Below is my
code:

Dim MessageProcessing As New SageQuestMailer

SendMailMessage(EmailAddresses)

Function SendMailMessage(ByVal EmailAddresses)

Dim ToAddress As String = "lb***@sage-quest.com"
Dim FromAddress As String = "SageQuest Alert Processor"
Dim Subject As String = "Alert Message"
Dim TextMessage As String = "This is a Canned Alert for Testing"

MessageProcessing.SendMail(ToAddress, FromAddress, Subject,
TextMessage)
End Function

Public Class SageQuestMailer
Inherits System.ComponentModel.Component

Public Function SendMail(ByVal ToAddress, ByVal FromAddress, ByVal
Subject, ByVal TextMessage)
Try

Dim MailMessage As MailMessage = New MailMessage
Dim OutboundSMTP As SmtpMail

OutboundSMTP.SmtpServer = "sage-quest.com"
MailMessage.To = ToAddress
MailMessage.From = FromAddress
MailMessage.Subject = Subject
MailMessage.Body = TextMessage

OutboundSMTP.Send(MailMessage)

Catch ex As Exception

End Try
End Function

When I execute the above function I get the following exception:

Could Not Access 'CDO.Message' object.

What am I missing here? I've added the "COM" refrences to my project and
also "ActiveX Data objects" as well.

Nothing seems to help here. Again What am I missing here.
Thanks

Nov 21 '05 #3

P: n/a
Hi Larry,

Go to google and put in 'could not access cdo message' - you will find that
this is the biggest headache in vb .net re email and all kinds of ideas that
may be causing the problem.

HTH,

Bernie Yaeger
PS - how's the jump shot, these days?
"Larry Bird" <La*******@discussions.microsoft.com> wrote in message
news:0B**********************************@microsof t.com...
I have a VB.Net service that I'm trying to send e-mail from. Below is my
code:

Dim MessageProcessing As New SageQuestMailer

SendMailMessage(EmailAddresses)

Function SendMailMessage(ByVal EmailAddresses)

Dim ToAddress As String = "lb***@sage-quest.com"
Dim FromAddress As String = "SageQuest Alert Processor"
Dim Subject As String = "Alert Message"
Dim TextMessage As String = "This is a Canned Alert for Testing"

MessageProcessing.SendMail(ToAddress, FromAddress, Subject,
TextMessage)
End Function

Public Class SageQuestMailer
Inherits System.ComponentModel.Component

Public Function SendMail(ByVal ToAddress, ByVal FromAddress, ByVal
Subject, ByVal TextMessage)
Try

Dim MailMessage As MailMessage = New MailMessage
Dim OutboundSMTP As SmtpMail

OutboundSMTP.SmtpServer = "sage-quest.com"
MailMessage.To = ToAddress
MailMessage.From = FromAddress
MailMessage.Subject = Subject
MailMessage.Body = TextMessage

OutboundSMTP.Send(MailMessage)

Catch ex As Exception

End Try
End Function

When I execute the above function I get the following exception:

Could Not Access 'CDO.Message' object.

What am I missing here? I've added the "COM" refrences to my project and
also "ActiveX Data objects" as well.

Nothing seems to help here. Again What am I missing here.
Thanks

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.