locked
why the eroor caused "can't access 'CDO.Message' object" when I am sending mail? RRS feed

  • Question

  • User602528402 posted

     I trid 30 times , it only success 3 times

    almost of time , shows  cant access 'CDO.Message' object?

    why?

    my code is below

                    MailMessage MObj = new MailMessage();
                    System.Text.StringBuilder sb = new System.Text.StringBuilder();

                    sb.Append("UserName: " + Name ) ;
                    sb.Append("\n");
                    sb.Append("Password:" + PW);

                    MObj.To = Mail;
                    MObj.From = "RELove";
                    MObj.BodyFormat = MailFormat.Text;
                    MObj.Subject = "【user Password】";
                    MObj.Body = sb.ToString();
                   
                    SmtpMail.SmtpServer = "ms21.hinet.net";
                    SmtpMail.Send(MObj);

    Monday, September 8, 2008 10:20 PM

All replies

  • User1234629706 posted

    As far as I know CDO was used in classic ASP, for sending mails, but the code you have provided looks like Microsoft VB.NET codes piece

    Anyway you can check this link, this has got some solutions for the error given by you

    http://www.systemwebmail.com/faq/4.2.3.aspx

    Tuesday, September 9, 2008 4:37 AM
  • User602528402 posted

     hi thank you  , I did this way

    Suggestion 6
    I have no idea why this suggestion works, but I found it on the web. I figured I would mention it, just in case Suggestion 1 did not work. Instead of specifying

    SmtpMail.SmtpServer = "127.0.0.1"
    try
    SmtpMail.SmtpServer.Insert( 0, "127.0.0.1 or your mail server name here")
     
    but I got another problem , I didn't catch any error and the message shows mail sent success !!
    I tried sent mail to myself ... ( tried 3 kind of mail  , yahoo, hotmail, gmail) I didn't receive anything..
    why ?
     
    thank you

     

    Tuesday, September 9, 2008 3:16 PM