'Could not access CDO.Message object'
-
I am using the code below to send the email, but the problem is that when I am working locally (localhost) using the client smtpserver, username and password, it is working fine but when I built the project and upload files and DLL on the ftpserver. And test the project on internet it throws message 'Could not access CDO.Message object'. Can anyone help in this regard. objMailmessage.From = Request["email"]; objMailmessage.To = "asd@veri.com"; objMailmessage.Subject = "Brochure Request"; objMailmessage.Body= strMailbody; objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smptserver); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", username); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", password); try { SmtpMail.Send(objMailmessage); } catch(System.Web.HttpException ehttp) { lblerror.Text=ehttp.Message; } Best of Luck
-
I am using the code below to send the email, but the problem is that when I am working locally (localhost) using the client smtpserver, username and password, it is working fine but when I built the project and upload files and DLL on the ftpserver. And test the project on internet it throws message 'Could not access CDO.Message object'. Can anyone help in this regard. objMailmessage.From = Request["email"]; objMailmessage.To = "asd@veri.com"; objMailmessage.Subject = "Brochure Request"; objMailmessage.Body= strMailbody; objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smptserver); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", username); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", password); try { SmtpMail.Send(objMailmessage); } catch(System.Web.HttpException ehttp) { lblerror.Text=ehttp.Message; } Best of Luck
Check out http://www.systemwebmail.com/[^] With System.Web.Mail namespace, you should always check out the available InnerException, which would carry the exact error messages. Sometimes, only second or third level InnerException carries the exact error message. :confused: Vasudevan Deepak Kumar Personal Web: http://www.lavanyadeepak.tk/ I Blog At: http://deepak.blogdrive.com/ http://deepakvasudevan.blogspot.com/
-
I am using the code below to send the email, but the problem is that when I am working locally (localhost) using the client smtpserver, username and password, it is working fine but when I built the project and upload files and DLL on the ftpserver. And test the project on internet it throws message 'Could not access CDO.Message object'. Can anyone help in this regard. objMailmessage.From = Request["email"]; objMailmessage.To = "asd@veri.com"; objMailmessage.Subject = "Brochure Request"; objMailmessage.Body= strMailbody; objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smptserver); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", username); objMailmessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", password); try { SmtpMail.Send(objMailmessage); } catch(System.Web.HttpException ehttp) { lblerror.Text=ehttp.Message; } Best of Luck
I second the previous reply. The
InnerExceptions
are all-important when working with System.Web.Mail objects.