public void sendMail()
{   
try
{
System.Web.Mail.MailMessage myMail=new MailMessage();
myMail.From = "[email protected]";
myMail.To = "[email protected]";
myMail.Subject = "MailTest";
myMail.Priority = MailPriority.High;
         myMail.BodyFormat = MailFormat.Html;
myMail.Body = "Test";
         SmtpMail.SmtpServer="192.168.1.206";
SmtpMail.Send(myMail);    
}   
catch(Exception e)
{
throw e;     
}
}未能访问“CDO.Message”对象由于服务器拒绝收件人之一,无法发送邮件。被拒绝的电子邮件地址是“[email protected]”。 主题 'test', 帐户: '192.168.1.206', 服务器: '192.168.1.206', 协议: SMTP, 服务器响应: '550 5.7.1 Unable to relay for [email protected], 端口: 25, 安全(SSL): 否, 服务器错误: 550, 错误号: 0x800CCC79
怎么样解决这个问题??

解决方案 »

  1.   

    using System.Web.Mail;
    MailMessage mm=new MailMessage();
    mm.From="[email protected]";
    mm.To="[email protected]";
    mm.Subject="subject";
    mm.Body="my name is zb";
    mm.Fields.Add(@"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //表示基本验证
    mm.Fields.Add(@"http://schemas.microsoft.com/cdo/configuration/sendusername", 你邮件的用户名); //在my_username_here处添加如163这样的身份验证的用户名
    mm.Fields.Add(@"http://schemas.microsoft.com/cdo/configuration/sendpassword", 你邮件的密码); // 在your_password_here处输入密码
    SmtpMail.SmtpServer = "smtp.126.com";  //邮件服务器地址
    Response.Write("<script>alert('succeed!!!')</script>");
    SmtpMail.Send(mm);
      

  2.   

    问题可能在邮件服务器的smpt的设置上!~~~~~你去网上查察,如何正确配置邮件服务器!~~~