Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2006

Tip: Looking for answers? Try searching our database.

Exception using SmtpMail.Send method

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
olrt - 06 Jul 2006 18:14 GMT
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 ??
Kevin Spencer - 06 Jul 2006 19:48 GMT
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.

Signature

HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

Big thicks are made up of lots of little thins.

> Hello, I checked the SmtpMail.SmtpServer
> I checked the recipients address of the message
[quoted text clipped - 18 lines]
>
> Can someone help ??
olrt - 06 Jul 2006 21:43 GMT
> 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 ?
Kevin Spencer - 06 Jul 2006 22:49 GMT
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).

Signature

HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

Big thicks are made up of lots of little thins.

>> Are you sure that CDO is installed on that machine? CDO is a COM object
>> that
[quoted text clipped - 5 lines]
> I work with .NET Framework 1.1
> How can I check that CDO is installed ?
olrt - 07 Jul 2006 12:13 GMT
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 ?
olrt - 07 Jul 2006 13:27 GMT
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 !!
Kevin Spencer - 07 Jul 2006 16:41 GMT
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.

Signature

HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

Big thicks are made up of lots of little thins.

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 !!
Kevin Spencer - 07 Jul 2006 16:40 GMT
> 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?u
rl=/servicedesks/webcasts/en/wcd012203/manifest.xml


Signature

HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

Big thicks are made up of lots of little thins.

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
[quoted text clipped - 3 lines]
> 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 ?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.