MailMessage m = new MailMessage();
        m.From = "[email protected]";
        m.To = "[email protected]";
        m.Subject = "测试邮件";
        m.Body = "测试邮件内容";
        m.Priority = MailPriority.High;
        m.BodyFormat = MailFormat.Html;
        SmtpMail.SmtpServer = "smtp.163.com";
        m.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
            "1"); //basic authentication
        m.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
            "qcnet"); //set your username here
        m.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
            "*******"); //set your password here
        SmtpMail.Send(m);请问我换了smtp.163.com成其它的邮箱和服务器为什么不行?
其它服务器如:
smtp.yahoo.com.cn则出现 与服务器的传输连接失败。之类的错误!请大家帮帮忙啊,谢了!!

解决方案 »

  1.   

    因为你的发送邮箱帐户[email protected]是在163上注册的,可以使用163的邮件服务器smtp.163.com发送信件
    但这个帐号在yahoo上一般是无效的,就算有效,密码也是不对的,无法使用smtp.yahoo.com.cn发送信件,因为帐户就没有通过验证如果要使用smtp.yahoo.com.cn发送邮件,可以在yahoo上先注册一个账号,然后操作和使用smtp.163.com是一样的
      

  2.   

    同时还要看人家是否支持SMTP协议.好象163.yahoo都没有提供SMTP服务吧,
      

  3.   

    163的我试过了可以通过..我用
    smtp.yahoo.com.cn
    smtp.qq.com
    的服务器,邮箱,密码都不行.
      

  4.   

    m.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", 
                            "*******"); //set   your   password   here 
    SmtpMail.Send(m); 在SmtpMail.Send(m); 这一句之前添加
    SmtpMail.SmtpServer = "smtp.yahoo.com.cn";