我用jmail发邮件的时候报“COM object with CLSID {E5FF9F62-0E7C-4372-8AD5-DA7D2418070C} is either not valid or not registered.”这样的错误。
用.net自带的web.mail发邮件报Could not access 'CDO.Message' object这样的错。
这是为啥?

解决方案 »

  1.   

    jmail的

    log.MethodIn();
        jmail.Message GXMail = new jmail.MessageClass();
    GXMail.From = "[email protected]"; //发件人地址
    GXMail.FromName = "考勤系统";
    GXMail.Silent = true;
    GXMail.Logging = true;
    GXMail.MailServerUserName = "[email protected]";//发件人地址
    GXMail.MailServerPassWord = "gaoxinmail";  //发件人密码
    GXMail.AddRecipient(toadd,null,null);  //收件人地址
    GXMail.Subject = subject;  //主题
    GXMail.Charset = "GB2312"; //编码
    GXMail.Body = bodytxt;    //正文
    GXMail.ContentType = "text/html";//正文格式
    try
    {
    GXMail.Send("gxmail.gxsotech.com",false); //发送
    }
    catch(Exception ex)

    log.Debug(ex.Message);
    Msg.ExceptionDeal(ex.Message);
    }
    log.MethodOut();
      

  2.   

    web.mail的
    MailMessage MyMail = new MailMessage();
    MyMail.From = "[email protected]";
    MyMail.To = toadd;
    MyMail.BodyEncoding = System.Text.Encoding.UTF8;
    MyMail.Subject = subject;
    MyMail.BodyFormat = MailFormat.Html;
    MyMail.Body = bodytxt;
    MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); 
    MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername","[email protected]"); 
    MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "gaoxinmail");  System.Web.Mail.SmtpMail.SmtpServer = "gxmail.gxsotech.com";
    try
    {
    System.Web.Mail.SmtpMail.Send(MyMail);
    }
    catch(Exception ex)

    Msg.ExceptionDeal(ex.Message);
    }
      

  3.   

    jmail注册了没?
    regsvr32 jmail.dll