473,832 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send Mail VB.Net Error Message

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

Dim MessageProcessi ng 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"

MessageProcessi ng.SendMail(ToA ddress, FromAddress, Subject,
TextMessage)
End Function

Public Class SageQuestMailer
Inherits System.Componen tModel.Componen t

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

Dim MailMessage As MailMessage = New MailMessage
Dim OutboundSMTP As SmtpMail

OutboundSMTP.Sm tpServer = "sage-quest.com"
MailMessage.To = ToAddress
MailMessage.Fro m = FromAddress
MailMessage.Sub ject = Subject
MailMessage.Bod y = TextMessage

OutboundSMTP.Se nd(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
3 3079
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 MessageProcessi ng 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"

MessageProcessi ng.SendMail(ToA ddress, FromAddress, Subject,
TextMessage)
End Function

Public Class SageQuestMailer
Inherits System.Componen tModel.Componen t

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

Dim MailMessage As MailMessage = New MailMessage
Dim OutboundSMTP As SmtpMail

OutboundSMTP.Sm tpServer = "sage-quest.com"
MailMessage.To = ToAddress
MailMessage.Fro m = FromAddress
MailMessage.Sub ject = Subject
MailMessage.Bod y = TextMessage

OutboundSMTP.Se nd(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
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*******@disc ussions.microso ft.com> wrote in message
news:0B******** *************** ***********@mic rosoft.com...
I have a VB.Net service that I'm trying to send e-mail from. Below is my
code:

Dim MessageProcessi ng 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"

MessageProcessi ng.SendMail(ToA ddress, FromAddress, Subject,
TextMessage)
End Function

Public Class SageQuestMailer
Inherits System.Componen tModel.Componen t

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

Dim MailMessage As MailMessage = New MailMessage
Dim OutboundSMTP As SmtpMail

OutboundSMTP.Sm tpServer = "sage-quest.com"
MailMessage.To = ToAddress
MailMessage.Fro m = FromAddress
MailMessage.Sub ject = Subject
MailMessage.Bod y = TextMessage

OutboundSMTP.Se nd(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
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*******@disc ussions.microso ft.com> wrote in message
news:0B******** *************** ***********@mic rosoft.com...
I have a VB.Net service that I'm trying to send e-mail from. Below is my
code:

Dim MessageProcessi ng 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"

MessageProcessi ng.SendMail(ToA ddress, FromAddress, Subject,
TextMessage)
End Function

Public Class SageQuestMailer
Inherits System.Componen tModel.Componen t

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

Dim MailMessage As MailMessage = New MailMessage
Dim OutboundSMTP As SmtpMail

OutboundSMTP.Sm tpServer = "sage-quest.com"
MailMessage.To = ToAddress
MailMessage.Fro m = FromAddress
MailMessage.Sub ject = Subject
MailMessage.Bod y = TextMessage

OutboundSMTP.Se nd(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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2461
by: Cameron Eckman | last post by:
I get various errors when I try to use email on the machine I have. XP professional. It works fine on another machine with NT 2000 server. Below is the code: 'BEGIN CODE Dim oMail As New MailMessage() With oMail .From = "mypc@baxglobal.com" .To = "ceckman@baxglobal.com"
1
6294
by: michi | last post by:
Hi there.... Got here a tricky thing with my SMTP. First I show you what works on my machine.. **This Works** SmtpMail.SmtpServer = "mail.gmx.net" <-gmx is my mail provider SmtpMail.Send"mymail@gmx.net", "somebody@xxx.ch", "sub",
0
2537
by: Erwan | last post by:
I have a strange (but very blocking) result when using the smtpmail class from an ASPX page : here is the (very simple !) code... '-------------------------------------------------- mail.To = "el@illico.fr" mail.From = "el@illico.fr" mail.Subject = "test envoi de mail" mail.Body = "test envoi de mail"
3
9258
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect. I think it is a relay issue. Our system administrator will not allow relaying. In the ASP.Net web.config file I let the web application...
4
7555
by: Aren Cambre | last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's BodyFormat = MailFormat.Html? I've searched all over the place and cannot find a solution anywhere. I am running this on Windows XP SP2, and IIS's SMTP and WWW servers are installed. Here is the error trace: System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an...
3
4562
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a windows application it worked fine, however I need to use a service as I don't want to rely on a user being logged in. The errors I get are: Index #:System.Web.HttpException: Could not access 'CDO.Message' object. --->...
2
3502
by: Ryan | last post by:
Hi, I receive an access denied error (see below) when attempting to send an email with BodyFormat=MailFormat.Html from an asp.net page. Exactly the same code works fine in a console application, and also succeeds from the asp.net page with BodyFormat=MailFormat.Text. I've recently upgraded from W2K SP4 to WinXP SP2 and am using .Net Framework v1.1 SP1. The code worked fine under W2K SP4.
14
2301
by: Professor Yonce | last post by:
I have made form for E-Mail. I have entered code but the Import system does not work. It has squiggly line underneath it showing it is not communicating. It Will not build. Public Class Form3Bio1 System.Net.Mail.SmtpClient Imports System.Net.Mail ' This line before ' does not work. I have the rest of code to try if and when I am able to get System working. ' I XXX out certain entrys below just for this publication.
4
4263
by: Tony M | last post by:
VS 2005 - XP media - VB .net - winforms - .net 2.0 Just trying to send an email, here is the code and the error message that I get. I can't figure out how to fix it?
5
4102
by: pat | last post by:
Hi, i'am using an ac2K progrom which sends automaticle emails with an attachment. Since last week , a error occurs with number 2293. Our mail program is Outlook 2003. It's probably a matter of safety in outlook, but i didn't saw an answer to prevent this error on theweb. Where can i configure the safetyitem that Outlook sees the mail not langer
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10780
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10498
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10540
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9319
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5623
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4421
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.