473,385 Members | 1,869 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,385 software developers and data experts.

Could not access 'CDO.Message' object

I've already searched Google. I've already asked people in IRC. I have still
not found a solution that works for me for this extremely discouraging
apparent bug in the SmtpMail class.

MailMessage message = new MailMessage();
// set params here
SmtpMail.SmtpServer = "mail.myispmailserver.com";
SmtpMail.Send(message);

This works if I run it in a console application on my Windows Server 2003
box. However if I execute the *exact same code* from my ASP.NET application
I receive the error message in the subject line.

I have heard various "fixes" for this, including setting permissions on
mailroot, and "explanations," including "the process ASP.NET serves pages
under is not allowed to create sockets except to localhost."

Will someone, preferrably from Microsoft, please tell me why this error
occurs (the REAL reason) and what I can do to get around it? Using an SMTP
virtual server on this box is undesirable.

Thanks.

Nathan Alden
MCSD
Nov 17 '05 #1
3 11773
Nathan,
I had the same problem, after checking the innerExceptions I found out that
this is a problem of the mailserver not allowing you to relay e-mail. Check
your inner exceptions,
Dim sw As New System.IO.StreamWriter("<YourWebLocation>\err.log" , True)

sw.WriteLine("Error " & vbCrLf & vbCrLf & ex.Message)
sw.WriteLine("InnerException 1 = " & vbCrLf & vbCrLf &
ex.InnerException.Message)
sw.WriteLine("InnerException 2 = " & vbCrLf & vbCrLf &
ex.InnerException.InnerException.Message)
sw.Close()

if there is a relay problem then DON'T set the smtpServer property, just dot
it like this :

MailMessage message = new MailMessage();
// set params here
// SmtpMail.SmtpServer = "mail.myispmailserver.com";
SmtpMail.Send(message);

that worked for me !!

Hope this helps.

Jurjen de Groot
G.I.T.S., Netherlands
"Nathan Alden" <li*****@hotmail.com> wrote in message
news:eR**************@TK2MSFTNGP11.phx.gbl...
I've already searched Google. I've already asked people in IRC. I have still not found a solution that works for me for this extremely discouraging
apparent bug in the SmtpMail class.

MailMessage message = new MailMessage();
// set params here
SmtpMail.SmtpServer = "mail.myispmailserver.com";
SmtpMail.Send(message);

This works if I run it in a console application on my Windows Server 2003
box. However if I execute the *exact same code* from my ASP.NET application I receive the error message in the subject line.

I have heard various "fixes" for this, including setting permissions on
mailroot, and "explanations," including "the process ASP.NET serves pages
under is not allowed to create sockets except to localhost."

Will someone, preferrably from Microsoft, please tell me why this error
occurs (the REAL reason) and what I can do to get around it? Using an SMTP
virtual server on this box is undesirable.

Thanks.

Nathan Alden
MCSD

Nov 17 '05 #2
Yes actually I had investigated the InnerExceptions and I've found it's
anything from 451 responses (LF only not allowed) to "cannot connect" etc.

"Jurjen de Groot" <in**@gits-online.nl> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...
Nathan,
I had the same problem, after checking the innerExceptions I found out that this is a problem of the mailserver not allowing you to relay e-mail. Check your inner exceptions,
Dim sw As New System.IO.StreamWriter("<YourWebLocation>\err.log" , True)

sw.WriteLine("Error " & vbCrLf & vbCrLf & ex.Message)
sw.WriteLine("InnerException 1 = " & vbCrLf & vbCrLf &
ex.InnerException.Message)
sw.WriteLine("InnerException 2 = " & vbCrLf & vbCrLf &
ex.InnerException.InnerException.Message)
sw.Close()

if there is a relay problem then DON'T set the smtpServer property, just dot it like this :

MailMessage message = new MailMessage();
// set params here
// SmtpMail.SmtpServer = "mail.myispmailserver.com";
SmtpMail.Send(message);

that worked for me !!

Hope this helps.

Jurjen de Groot
G.I.T.S., Netherlands
"Nathan Alden" <li*****@hotmail.com> wrote in message
news:eR**************@TK2MSFTNGP11.phx.gbl...
I've already searched Google. I've already asked people in IRC. I have

still
not found a solution that works for me for this extremely discouraging
apparent bug in the SmtpMail class.

MailMessage message = new MailMessage();
// set params here
SmtpMail.SmtpServer = "mail.myispmailserver.com";
SmtpMail.Send(message);

This works if I run it in a console application on my Windows Server 2003 box. However if I execute the *exact same code* from my ASP.NET

application
I receive the error message in the subject line.

I have heard various "fixes" for this, including setting permissions on
mailroot, and "explanations," including "the process ASP.NET serves pages under is not allowed to create sockets except to localhost."

Will someone, preferrably from Microsoft, please tell me why this error
occurs (the REAL reason) and what I can do to get around it? Using an SMTP virtual server on this box is undesirable.

Thanks.

Nathan Alden
MCSD


Nov 17 '05 #3
Has anyone resolved this issue?

Our development server has migrated to another network, and now
resides as a DMZ. From the exact same box, "old" asp code can send
emails perfectly, i have spent a little over 6 hours trying to resolve
this problem trying everything mentioned in every google thread
pertinent to this problem. Before the migration, we were able to send
emails out. Now, nothing I do configuration wise seems to work.

Things I've tried:
-Changing permissions on every dll related to CDO
-Changing permissions on every directory related
-Changing relay options
-Changing smtp servers
-Impersonation for the aspnet_wp application in web.config
-changing machine.config

ASP.NET blows if it can't handle such a simple task. Why is this so
difficult? Where is microsoft to step in and enlighten us on this
"undocumented feature".

I'm at a complete loss.

Anyone with the solution, please let me/the world know.

Thanks.

-Brenton
"Nathan Alden" <li*****@hotmail.com> wrote in message news:<u6**************@TK2MSFTNGP11.phx.gbl>...
Yes actually I had investigated the InnerExceptions and I've found it's
anything from 451 responses (LF only not allowed) to "cannot connect" etc.

"Jurjen de Groot" <in**@gits-online.nl> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...
Nathan,
I had the same problem, after checking the innerExceptions I found out

that
this is a problem of the mailserver not allowing you to relay e-mail.

Check
your inner exceptions,
Dim sw As New System.IO.StreamWriter("<YourWebLocation>\err.log" , True)

sw.WriteLine("Error " & vbCrLf & vbCrLf & ex.Message)
sw.WriteLine("InnerException 1 = " & vbCrLf & vbCrLf &
ex.InnerException.Message)
sw.WriteLine("InnerException 2 = " & vbCrLf & vbCrLf &
ex.InnerException.InnerException.Message)
sw.Close()

if there is a relay problem then DON'T set the smtpServer property, just

dot
it like this :

MailMessage message = new MailMessage();
// set params here
// SmtpMail.SmtpServer = "mail.myispmailserver.com";
SmtpMail.Send(message);

that worked for me !!

Hope this helps.

Jurjen de Groot
G.I.T.S., Netherlands
"Nathan Alden" <li*****@hotmail.com> wrote in message
news:eR**************@TK2MSFTNGP11.phx.gbl...
I've already searched Google. I've already asked people in IRC. I have still not found a solution that works for me for this extremely discouraging
apparent bug in the SmtpMail class.

MailMessage message = new MailMessage();
// set params here
SmtpMail.SmtpServer = "mail.myispmailserver.com";
SmtpMail.Send(message);

This works if I run it in a console application on my Windows Server 2003 box. However if I execute the *exact same code* from my ASP.NET application I receive the error message in the subject line.

I have heard various "fixes" for this, including setting permissions on
mailroot, and "explanations," including "the process ASP.NET serves pages under is not allowed to create sockets except to localhost."

Will someone, preferrably from Microsoft, please tell me why this error
occurs (the REAL reason) and what I can do to get around it? Using an SMTP virtual server on this box is undesirable.

Thanks.

Nathan Alden
MCSD


Nov 17 '05 #4

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

Similar topics

4
by: Thys Brits | last post by:
Hi, I'm using the System.Web.Mail class to send an e-mail from my ASP.Net application, but when sending the e-mail, I'm getting the above error. It seems to be because I have Office XP...
2
by: Janna Deegan | last post by:
Hello all, First off, if there is a better place to post for an answer to this question, please feel free to point me there. I have some very strange behavior happening with my System.web.mail...
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...
1
by: Jens Øster | 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...
3
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...
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...
4
by: Liz Patton | last post by:
Here's the exception: System.Exception: Unable to send mail: Could not access 'CDO.Message' object. ---> System.Web.HttpException: Could not access 'CDO.Message' object. --->...
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...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.