{"Could not access 'CDO.Message' object." }
-
Hello buddies, I tried to develop a mail sender application who gathers message properties thru a form and then constructs a System.Web.Mail.MailMessage object: MailMessage msg = new MailMessage(); // Setting 'msg' properties... SmtpMail.SmtpServer = "mail.mydomain.com"; SmtpMail.Send(msg); but an exception of type "System.Web.HttpException" occures with the following message: "Could not access 'CDO.Message' object." What the problem can be? Thanks --- "Art happens when you least expect it."
-
Hello buddies, I tried to develop a mail sender application who gathers message properties thru a form and then constructs a System.Web.Mail.MailMessage object: MailMessage msg = new MailMessage(); // Setting 'msg' properties... SmtpMail.SmtpServer = "mail.mydomain.com"; SmtpMail.Send(msg); but an exception of type "System.Web.HttpException" occures with the following message: "Could not access 'CDO.Message' object." What the problem can be? Thanks --- "Art happens when you least expect it."
mmm, yes I have had this before. It is a default message when calling the SmtpMail.Send method. Have you added any attachements to the message, if so, make sure that they are accessible! Make sure that you are specifiying a valid SMTP server. Does the SMTP server require authentication?
-
mmm, yes I have had this before. It is a default message when calling the SmtpMail.Send method. Have you added any attachements to the message, if so, make sure that they are accessible! Make sure that you are specifiying a valid SMTP server. Does the SMTP server require authentication?
First thank u for the reply. I haven't added any attachments. My SMTP server is valid but I don't know if it needs authentication or not, Also I can't figure out how can I send credentials to get authenticated if the server requires. Can u tell me? Also is there any free no-authentication smtp server on the net so I can test my app with? what about my WindowsXP pro virtual SMTP server how can I use that to test my app? Thank u --- "Art happens when you least expect it."
-
Hello buddies, I tried to develop a mail sender application who gathers message properties thru a form and then constructs a System.Web.Mail.MailMessage object: MailMessage msg = new MailMessage(); // Setting 'msg' properties... SmtpMail.SmtpServer = "mail.mydomain.com"; SmtpMail.Send(msg); but an exception of type "System.Web.HttpException" occures with the following message: "Could not access 'CDO.Message' object." What the problem can be? Thanks --- "Art happens when you least expect it."
This URL may help you.. Regards K RaviKumar
-
Hello buddies, I tried to develop a mail sender application who gathers message properties thru a form and then constructs a System.Web.Mail.MailMessage object: MailMessage msg = new MailMessage(); // Setting 'msg' properties... SmtpMail.SmtpServer = "mail.mydomain.com"; SmtpMail.Send(msg); but an exception of type "System.Web.HttpException" occures with the following message: "Could not access 'CDO.Message' object." What the problem can be? Thanks --- "Art happens when you least expect it."
This URL may help you.. http://www.dotnet247.com/247reference/a.aspx?u=http://www.dotnetjunkies.com/Tutorial/7D8C8892-397A-400B-AD22-188B8F4F53C9.dcik Regards K RaviKumar
-
First thank u for the reply. I haven't added any attachments. My SMTP server is valid but I don't know if it needs authentication or not, Also I can't figure out how can I send credentials to get authenticated if the server requires. Can u tell me? Also is there any free no-authentication smtp server on the net so I can test my app with? what about my WindowsXP pro virtual SMTP server how can I use that to test my app? Thank u --- "Art happens when you least expect it."
Here is some sample code for authenticating against an SMTP server. You could just set up your own Virtual SMTP server for testing purposes and not have to worry about authenticating just yet. Someone else has replied with a useful link for that already. Here is the code: System.Web.Mail.MailMessage ms = new System.Web.Mail.MailMessage(); ms.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); ms.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "myUsername"); ms.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "myPassword"); ms.To = "you@yourcompanyaaaxxx.com"; ms.From = "me@mycompanyaaaxxx.com"; ms.Subject = "test message"; ms.Body = "the body of my message"; System.Web.Mail.SmtpMail.SmtpServer = "mail.mycompanyaaaxxx.com"; System.Web.Mail.SmtpMail.Send(ms); HTH Nick