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?


    my code is below

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

                    sb.Append("UserName: " + Name ) ;
                    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";

    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


    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 = ""
    SmtpMail.SmtpServer.Insert( 0, " 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