| Author |
Thread |
| I am getting this cdo.message object error on smtpmail.mail |
|
Posted in tutorial: Sending E-Mails using ASP.NET |
· efanwick
Joined: 5 Dec 2002 Total Posts: 1 |
I am getting this cdo.message object error on smtpmail.mail Posted: 5 Dec 2002
I have the following code: Public Sub SendMail() 'ByVal Subject As String, ByVal SendTo As String, ByVal Message As String Try Dim Mailx As New MailMessage() With Mailx .From = "eric.fanwick@misys.com" .To = "efanwick@familytime.com" .Cc = "eric@fanwick.com" .Subject = "the smtp test 4" .BodyFormat = MailFormat.Text .Body = "test test test..." .Priority = MailPriority.Normal End With Dim ProcessMail As Mail.SmtpMail 'ProcessMail.SmtpServer = "smtp.misys.com" SmtpMail.Send(Mailx) Catch Dim x As Integer x = 3 End Try End Sub After the command SmtpMail.Send(Mailx) I get the message "Could not access 'CDO.Message' object." Do you know why? Eric
Eric
|
· seanie81
Joined: 6 Dec 2002 Total Posts: 2 |
I am getting this cdo.message object error on smtpmail.mail Posted: 6 Dec 2002
I have the same following code:
"Could not access 'CDO.Message' object."
|
· Faisal Khan
Joined: 24 Sep 2002 Total Posts: 547 |
And I got this message too :) Posted: 6 Dec 2002
Guess what when I was writing part 2 of this article, I also got this message, so here is what I did.
First make sure SMTP service is running by issuing "net start smtpsvc" command at the command prompt. If you still get this error message or if the service doesn't start throwing back an error message then do this.
Reinstall SMTP service. Yes that's right, you don't need to reinstall complete IIS back but just SMTPSVC. If you don't know how to reinstall SMTPSVC without troubling IIS then ask and I'll explain.
After reinstalling SMTP service I tried this script again and it worked straight away.
The reason that we got this message ( and people usually do ) is that System.Web.Mail namespace uses native COM wrappers to communicate with the SMTPSVC. So if there is something wrong with COM dlls ( even if SMTPSVC is running ) then it will throw 'CDO blah blah' error message back. Best would have been for Microsoft to have provided a complete managed namespace for this purpose.
So here is my advice, reinstall SMTPSVC ( only, don't hurt IIS ).
|
· Sasha
Joined: 23 Feb 2003 Total Posts: 1 |
"If you don't know how to reinstall SMTPSVC without troubling IIS then ask and I'll explain." Posted: 23 Feb 2003
newbie, yes please... thanks in advance
|
· jviele
Joined: 27 Mar 2003 Total Posts: 1 |
That's not it! Posted: 27 Mar 2003
Hello.
I got this error while sending mail in a loop to 143 different people (i.e. one e-mail per person). It failed on only ONE out of the 143, and it gave this same error.
Based on your explanation, it should have either worked or failed 100%. So, there is more to it than that.
My guess? runs out of memory if you don't suspend your thread long enough for CDO to process some of them. I haven't tested this theory yet.
Any takers?
|
· daveball
Joined: 10 Apr 2003 Total Posts: 1 |
Null or Blank From address? Posted: 10 Apr 2003
We had this problem also. After trying everything in this thread and building some stand alone test programs, we found that the error in our case was the following:
MailMessage message = new MailMessage(); message.From = userInfo.fullName + " <" + userInfo.userEmail + ">";
In this case, userInfo.userEmail was either null, DBNull.Value, or "". I did not check specifically. However, when we ensured there was a value there, it no longer failed.
I believe that the Microsoft developer that created these wrapper classes returns this error message in a generic catch.
Perhaps if you were to print out the values you are assigning to all of the MailMessage fields, you may find the issue.
|
· denmast
Joined: 19 Jun 2003 Total Posts: 1 |
how do we reinstall SMTPSVC without troubling IIS? Posted: 19 Jun 2003
If you could post this info, it would be much appreciated, thank you.
|
· alphaGulp
Joined: 10 Sep 2003 Total Posts: 1 |
too many smtp connections Posted: 10 Sep 2003
I have been having this problem as well. In particular, the send() command fails for one out of a bunch of sends of the same MailMessage.
When I look at the inner exceptions, I find this:
"The message could not be sent to the SMTP server. The transport error code was 0x800ccc67. The server response was 421 hall.mail.mindspring.net: Too many concurrent SMTP connections from one IP address; please try again later."
I will try doing some Application.DoEvents() and / or adding Sleep() calls to see if this fixes the problem. Sending emails shouldn't be so troublesome...
Christophe
|
· eyeful
Joined: 19 Feb 2004 Total Posts: 1 |
CDO Error Posted: 19 Feb 2004
Comment out the following line - it worked for me.
'SmtpMail.SmtpServer = "localhost"
eyeful Websites
|
· pogier
Joined: 25 Jan 2005 Total Posts: 1 |
The Solution Posted: 25 Jan 2005
Please look at this site, i found this and it was a perfect solution. http://www.systemwebmail.com/faq/4.2.3.aspx
|
· mworthly
Joined: 10 Jan 2006 Total Posts: 1 |
From: field not a valid email address Posted: 10 Jan 2006
I had a problem with this error and traced it to an invalid email format in the From: field.
It sure would be nice if the program returned a more specific error code.
Mike
|