473,320 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

WebMail Not Working! "Could not access 'CDO.Message' object"

I am trying to send mail via SMTP, using VB.NET on XP. I keep getting this
error: "Could not access 'CDO.Message' object." (I can send mail fine via
VB6, using CDONTS.)

I have added a reference to System.Web, and this is my code:

Try

WebMailMessage.From = Sender

WebMailMessage.To = Recipient

WebMailMessage.Body = Body

WebMailMessage.Subject = Subject

WebMail.SmtpServer = "localhost" 'Tried SMTPServerString and IP Number as
well

WebMail.Send(WebMailMessage)

Catch e As System.Exception

Debug.Write(e.Message)

MsgBox("SendMailMessage failed with the following exception:" & e.Message)

End Try
All of the values are passed by the class I wrote (Sender, Body, etc.). I
have tried switching the SMTP Server value to the name of my SMTP server,
and to its IP number, but I keep getting the same error. Do I need to add a
COM reference to CDO in my project or what?
Nov 21 '05 #1
1 2419
Check out:

http://www.systemwebmail.net/

You have added a reference to System.Web right?

If using SmtpServer = "localhost" you also have to setup your SMTP server on
the machine running your code to allow relaying to 127.0.0.1 (Look in
IIS->Default-SMTP->Properties->Access tab->Relay->Add 127.0.0.1)

HTH,
Greg
"Jason" <so*****@microsoft.com> wrote in message
news:ud**************@tk2msftngp13.phx.gbl...
I am trying to send mail via SMTP, using VB.NET on XP. I keep getting this
error: "Could not access 'CDO.Message' object." (I can send mail fine via
VB6, using CDONTS.)

I have added a reference to System.Web, and this is my code:

Try

WebMailMessage.From = Sender

WebMailMessage.To = Recipient

WebMailMessage.Body = Body

WebMailMessage.Subject = Subject

WebMail.SmtpServer = "localhost" 'Tried SMTPServerString and IP Number as
well

WebMail.Send(WebMailMessage)

Catch e As System.Exception

Debug.Write(e.Message)

MsgBox("SendMailMessage failed with the following exception:" & e.Message)

End Try
All of the values are passed by the class I wrote (Sender, Body, etc.). I
have tried switching the SMTP Server value to the name of my SMTP server,
and to its IP number, but I keep getting the same error. Do I need to add
a COM reference to CDO in my project or what?

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Desmond | last post by:
Hi, I would really appreciate if somebody could give some advise on this. I've a ASP.NET application that is supposed to send emails and it is tested to be working well on IIS 5.0 and tested...
2
by: Paul Glavich | last post by:
As you may have guessed, its sometimes generated when the SMTP server cannot be accessed, and this is reported as saying the class cannot be registered. I assume you dont have an SMTP server on...
1
by: Michael | last post by:
Hello, I've read a lot of threads on this subject, but they typically go back to a problem with the smtp server configuration. In my case, everything works great until I uncomment the one line...
2
by: MattB | last post by:
I've taken some working code from a vb clas library that was a part of a web application and put it into a stand alone class library so I can reuse it from other applications. I'm using some code...
3
by: pmud | last post by:
Hi, I have ab ASP.Net Application in which I need to send e-mail on button click. Even though my C# code for that is correct.I am getting the following error:: I think the following error can be...
2
by: Martin | last post by:
Hi, I have standard code that sends mail from an asp.net application. The application is running on a production web server. it uses the standard system.web.mail namespace. most of the time...
5
by: lds | last post by:
I am getting the following error: The "SendUsing" configuration value is invalid. Description: An unhandled exception occurred during the execution of the current web request. Please review the...
3
by: Anthony Fine | last post by:
Hello All, I have a VB.Net app that needs to send mail. I have created a class for building my e-mail, but keep getting the error (Could not access 'CDO.Message' object.) when trying to send...
1
by: tshad | last post by:
I am getting an error in my Windows Service which delivers my email. This program has been working for weeks. All of a sudden it quit working. I am getting the following errors: Could Not...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.