你是不是没有添加引用这个dll

解决方案 »

  1.   

    原因找到了,应该是环境版本过低的问题。我用同样的代码在公司一台装了.net framework1.1的机器上运行就能通过。
    我的问题可能是虽然装了1.1但是Visual Studio的调试环境还是原来的环境,所以不能运行。
      

  2.   

    http://blog.csdn.net/zhzuo/archive/2004/07/12/39459.aspx
      

  3.   

    用jMail吧
    代码如下:
    jmail.MessageClass myMail=new jmail.MessageClass();

    myMail.Charset="GB2312";
    myMail.Silent=true;
    myMail.Priority=3;
    myMail.MailServerUserName="[email protected]";
    myMail.MailServerPassWord="*****";
    myMail.From="[email protected]";

    myMail.AddRecipient("[email protected]","testzhang","");
    myMail.Subject="this is a test";
    myMail.Body="this is a test ,author is zhangzhenliang";
        
    myMail.Send("smtp.126.com",false);
      

  4.   

    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "username"); //set your username here
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password"); //set your password here
    只支持v1.1及以上的版本