Home All Groups Group Topic Archive Search About

Exception using SmtpMail.Send method

Author
6 Jul 2006 5:14 PM
olrt
Hello, I checked the SmtpMail.SmtpServer
I checked the recipients address of the message
I checked the sender address

But still have the following exception when SmtpMail.Send :-( ::

-----------------------------------
Failed to send message : System.Web.HttpException: Unable to create
object 'CDO.Message'.
   at System.Web.Mail.LateBoundAccessHelper.get_LateBoundType()
   at System.Web.Mail.LateBoundAccessHelper.CreateInstance()
   at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
   at System.Web.Mail.SmtpMail.Send(MailMessage message)
   at Services.ServiceMail.SvcMail.envoyerMessageEmailSmtp(MailMessage
msg) in
-----------------------------------


I checked that my smtp server works and manually sent a message with
telnet on port 25 of
the server (it's Microsoft SMTP Server).

Can someone help ??

Author
6 Jul 2006 6:48 PM
Kevin Spencer
Are you sure that CDO is installed on that machine? CDO is a COM object that
is used by SmtpMail to send emails. If you have .Net 2.0 you can use the
System.Net.Mail Namespace classes instead, which do not rely on any COM
objects.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

Big thicks are made up of lots of little thins.


Show quote
"olrt" <o***@ifrance.com> wrote in message
news:1152206079.395549.28520@m79g2000cwm.googlegroups.com...
> Hello, I checked the SmtpMail.SmtpServer
> I checked the recipients address of the message
> I checked the sender address
>
> But still have the following exception when SmtpMail.Send :-( ::
>
> -----------------------------------
> Failed to send message : System.Web.HttpException: Unable to create
> object 'CDO.Message'.
>   at System.Web.Mail.LateBoundAccessHelper.get_LateBoundType()
>   at System.Web.Mail.LateBoundAccessHelper.CreateInstance()
>   at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
>   at System.Web.Mail.SmtpMail.Send(MailMessage message)
>   at Services.ServiceMail.SvcMail.envoyerMessageEmailSmtp(MailMessage
> msg) in
> -----------------------------------
>
>
> I checked that my smtp server works and manually sent a message with
> telnet on port 25 of
> the server (it's Microsoft SMTP Server).
>
> Can someone help ??
>
Author
6 Jul 2006 8:43 PM
olrt
Kevin Spencer wrote:
> Are you sure that CDO is installed on that machine? CDO is a COM object that
> is used by SmtpMail to send emails. If you have .Net 2.0 you can use the
> System.Net.Mail Namespace classes instead, which do not rely on any COM
> objects.
>
First, thanks a lot for your precious answer.
I work with .NET Framework 1.1
How can I check that CDO is installed ?
Author
6 Jul 2006 9:49 PM
Kevin Spencer
The easiest way would be using Visual Studio, with a Solution open, go to
the References item in the Solution view, right-click and select "Add
Reference..."

The COM tab shows all the COM objects registered on your machine. I believe
CDO will be called "Microsoft CDO..." (something or other).

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

Big thicks are made up of lots of little thins.


Show quote
"olrt" <o***@ifrance.com> wrote in message
news:1152218596.993008.283350@k73g2000cwa.googlegroups.com...
>
> Kevin Spencer wrote:
>> Are you sure that CDO is installed on that machine? CDO is a COM object
>> that
>> is used by SmtpMail to send emails. If you have .Net 2.0 you can use the
>> System.Net.Mail Namespace classes instead, which do not rely on any COM
>> objects.
>>
> First, thanks a lot for your precious answer.
> I work with .NET Framework 1.1
> How can I check that CDO is installed ?
>
Author
7 Jul 2006 11:13 AM
olrt
Kevin Spencer a écrit :

> The easiest way would be using Visual Studio, with a Solution open, go to
> the References item in the Solution view, right-click and select "Add
> Reference..."
>
> The COM tab shows all the COM objects registered on your machine. I believe
> CDO will be called "Microsoft CDO..." (something or other).
>


Hello.
I have progressed a little.
I did a regsvr32 cdosys.dll and now I have the following Exception
message :

-----------------------------------------------------------
System.Web.HttpException: Unable to access 'CDO.Message'. --->
System.Reflection.TargetInvocationException: ...... --->
System.Runtime.InteropServices.COMException (0x80040154): Class not
registered


What dll are used by CDO ?
Author
7 Jul 2006 12:27 PM
olrt
I got finally it working.
I commented out SmtpMail.SmtpServer="localhost";

It's weird that when one specify "localhost" in SmtpServer ,
SmtpMail.Send throws an exception !!!
I don't understand why.



So for those who want to have class SmtpMail work :
1°) regsvr32 cdosys.dll
2°) Install a local SMTP Server on the machine and comment
SmtpMail.SmtpServer

Hope it helps !!
Author
7 Jul 2006 3:41 PM
Kevin Spencer
Glad you got it working. The "localhost" error is probably a host name
resolution issue. I'm not sure how CDOSYS resolves host names, but putting
in the actual machine name or the IP address will work as well. It defaults
to the local machine in any case.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

Big thicks are made up of lots of little thins.


"olrt" <o***@ifrance.com> wrote in message
news:1152275241.087671.73710@p79g2000cwp.googlegroups.com...
I got finally it working.
I commented out SmtpMail.SmtpServer="localhost";

It's weird that when one specify "localhost" in SmtpServer ,
SmtpMail.Send throws an exception !!!
I don't understand why.



So for those who want to have class SmtpMail work :
1°) regsvr32 cdosys.dll
2°) Install a local SMTP Server on the machine and comment
SmtpMail.SmtpServer

Hope it helps !!
Author
7 Jul 2006 3:40 PM
Kevin Spencer
> I have progressed a little.
> I did a regsvr32 cdosys.dll and now I have the following Exception
> message :

You're skipping some important details:

1. Did you *find* a COM object named "cdosys.dll?"
2. Did the registration return a positive or negative response?

Assuming that the DLL is registered, I don't know of any external
dependencies of that DLL. You might try checking out the "Troubleshooting"
webcast from Microsoft:
http://support.microsoft.com/servicedesks/webcasts/seminar/shared/asp/view.asp?url=/servicedesks/webcasts/en/wcd012203/manifest.xml

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

Big thicks are made up of lots of little thins.


"olrt" <o***@ifrance.com> wrote in message
news:1152270792.813909.150600@m73g2000cwd.googlegroups.com...

Kevin Spencer a écrit :

> The easiest way would be using Visual Studio, with a Solution open, go to
> the References item in the Solution view, right-click and select "Add
> Reference..."
>
> The COM tab shows all the COM objects registered on your machine. I
> believe
> CDO will be called "Microsoft CDO..." (something or other).
>


Hello.
I have progressed a little.
I did a regsvr32 cdosys.dll and now I have the following Exception
message :

-----------------------------------------------------------
System.Web.HttpException: Unable to access 'CDO.Message'. --->
System.Reflection.TargetInvocationException: ...... --->
System.Runtime.InteropServices.COMException (0x80040154): Class not
registered


What dll are used by CDO ?

AddThis Social Bookmark Button