error could not access cdo.message
-
I am a beginner & was working on namespace system.web.mail. i was simply trying to mail a hello world message on the click of a button. BUT when i tried to do it i got an error message as follows System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040213): The transport failed to connect to the server. i have not configured my outlook express is it due to that, or is there some other problem. please help me. my code was as follows private void button1_Click(object sender, System.EventArgs e) { sendemail(); } public static void sendemail() { SmtpMail.SmtpServer = "www.hotmail.com"; MailMessage mm = new MailMessage(); mm.From = "casablancaknight@hotmail.com"; mm.To = "casablanca111@hotmail.com"; mm.Body = "hello"; mm.Subject = "hi"; SmtpMail.Send(mm); }
-
I am a beginner & was working on namespace system.web.mail. i was simply trying to mail a hello world message on the click of a button. BUT when i tried to do it i got an error message as follows System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040213): The transport failed to connect to the server. i have not configured my outlook express is it due to that, or is there some other problem. please help me. my code was as follows private void button1_Click(object sender, System.EventArgs e) { sendemail(); } public static void sendemail() { SmtpMail.SmtpServer = "www.hotmail.com"; MailMessage mm = new MailMessage(); mm.From = "casablancaknight@hotmail.com"; mm.To = "casablanca111@hotmail.com"; mm.Body = "hello"; mm.Subject = "hi"; SmtpMail.Send(mm); }
You specified a web page as the
SmtpServer
. You need to provide the address to the SMTP server. - Nick Parker
My Blog | My Articles