Send Mail VB.Net Error Message

G

Guest

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 = "(e-mail address removed)"
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
 
B

Bernie Yaeger

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?
 

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

Top