|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Exception using SmtpMail.Send methodI 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 ?? 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. -- Show quoteHTH, 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: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 ?? > Kevin Spencer wrote:
> Are you sure that CDO is installed on that machine? CDO is a COM object that First, thanks a lot for your precious answer.> 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. > I work with .NET Framework 1.1 How can I check that CDO is installed ? 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). -- Show quoteHTH, 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: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 ? > Kevin Spencer a écrit :
> The easiest way would be using Visual Studio, with a Solution open, go to Hello.> 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). > 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 ? 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 !! 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 I got finally it working.news:1152275241.087671.73710@p79g2000cwp.googlegroups.com... 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 !! > I have progressed a little. You're skipping some important details:> I did a regsvr32 cdosys.dll and now I have the following Exception > message : 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 Kevin Spencer a écrit :news:1152270792.813909.150600@m73g2000cwd.googlegroups.com... > The easiest way would be using Visual Studio, with a Solution open, go to Hello.> 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). > 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 ? |
|||||||||||||||||||||||