Error:- Could not access 'CDO.Message' object.
-
Hi, I tried to send mail from c# windows application but i am unable to send the mail.i am getting the following error. An unhandled exception of type 'System.Web.HttpException' occurred in system.web.dll Additional information: Could not access 'CDO.Message' object. The code i wrote is System.Web.Mail.MailMessage mailMsg = new MailMessage(); mailMsg.From ="chand.p@icinfotech.com"; mailMsg.To = "chand.p@icinfotech.com"; mailMsg.Priority = MailPriority.High; mailMsg.Subject = subject; mailMsg.Body = body; mailMsg.BodyFormat = System.Web.Mail.MailFormat.Html; MailAttachment sFile = new MailAttachment(attachment); mailMsg.Attachments.Add(sFile); SmtpMail.SmtpServer = "127.0.0.1"; SmtpMail.Send(mailMsg); reply me if any one know the solution for this problem.
-
Hi, I tried to send mail from c# windows application but i am unable to send the mail.i am getting the following error. An unhandled exception of type 'System.Web.HttpException' occurred in system.web.dll Additional information: Could not access 'CDO.Message' object. The code i wrote is System.Web.Mail.MailMessage mailMsg = new MailMessage(); mailMsg.From ="chand.p@icinfotech.com"; mailMsg.To = "chand.p@icinfotech.com"; mailMsg.Priority = MailPriority.High; mailMsg.Subject = subject; mailMsg.Body = body; mailMsg.BodyFormat = System.Web.Mail.MailFormat.Html; MailAttachment sFile = new MailAttachment(attachment); mailMsg.Attachments.Add(sFile); SmtpMail.SmtpServer = "127.0.0.1"; SmtpMail.Send(mailMsg); reply me if any one know the solution for this problem.
Unless your local machine is the mail server you will need to set SmtpServer to a valid address, maybe something like mail.mycompany.com or 234.10.44.20
-
Unless your local machine is the mail server you will need to set SmtpServer to a valid address, maybe something like mail.mycompany.com or 234.10.44.20
hi thanks for replying me. i have used my company mail server but i am receiving the same error.i tried this in vs2003 but in vs2005 it is working fine.
-
hi thanks for replying me. i have used my company mail server but i am receiving the same error.i tried this in vs2003 but in vs2005 it is working fine.
If you are using VS2005 you should use the System.Net.Mail namespace, System.Web.Mail has been deprecated.
-
If you are using VS2005 you should use the System.Net.Mail namespace, System.Web.Mail has been deprecated.
Yes,i used System.Net.Mail namespace in vs2005.Do you have any alternate solution for my problem?if any,please kindly reply.
-
Yes,i used System.Net.Mail namespace in vs2005.Do you have any alternate solution for my problem?if any,please kindly reply.
I don't realy see that you have a problem. It works with VS2005 but not with VS2003, so the obvious answer is to use what works. Is there a reason why it needs to work using .NET 1.1?