代码如:
                           SmtpMail.SmtpServer.Insert(0,ComConfiguration.SMTPServer);
MailMessage mailMessage = new MailMessage();
mailMessage.Subject = mailObj.MailSubject;
mailMessage.From = mailObj.MailFrom;
mailMessage.BodyFormat = MailFormat.Html;
mailMessage.Body = mailObj.MailBody;
mailMessage.To = mailObj.Recipient; mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");  mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", @"[email protected]");  mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "1");SmtpMail.Send(mailMessage);用户名和密码都是正确的!

解决方案 »

  1.   

    http://jzywh.cnblogs.com/archive/2005/06/09/170783.html
      

  2.   

    MailMessage mail=new MailMessage();;
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1" ); 
    //basic authentication
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "username" ); //username是你163的用户名字
    // 设置smtp服务器登录账号(如您163.com的信箱账号)password为你163邮箱的密码 当然你有自己的邮件服务器 可以用你自己邮件服务器分给你的邮件地址的用户名称 用户密码
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password"); 
    mail.To=TextBox1.Text;
    mail.From=TextBox2.Text;//这里要填你的邮箱地址,才能发送成功 比如你的163用户名字为123 那么你在这里要填[email protected]
    mail.Subject=TextBox3.Text;
    if(Format.SelectedItem.Text=="纯文本格式")
    mail.BodyFormat=MailFormat.Text;
    else
    mail.BodyFormat=MailFormat.Html;
    mail.Body=TextBox4.Text;
    SmtpMail.SmtpServer ="smtp.163.com";SmtpMail.Send(mail);
    Label1.Text="成功";
      

  3.   

    我用的jmail发的。。用自带的好像不准时。。所以我放弃了。
      

  4.   

    TO: jzywh(江大鱼) ,这个我看不懂,你说的中继IP我应该设为什么呢??
    TO: yefeihaha() ,其实我和你的写法是一样的,但不能解决根本问题,问题是现在发送成功,但实际上收不到呢!
      

  5.   

    如果你公司有自己的邮件副 那你吧
    SmtpMail.SmtpServer ="smtp.163.com";
    改成你们公司的邮件服务器
    用户名字 和密码填分配给你的 
    mail.From=填你的邮件地址 一般邮件地址就是分配给你的用户名字加
      

  6.   

    “发送成功”意味着你的程序和smtp服务器联系成功,至于邮件能够发送到对方邮箱,与“发送成功”无关,邮件退回来估计你也没有程序去读取吧!如果你把自己的开发机器设置成smtp服务器,那么除非服务程序出错,否则永远都是成功的。
      

  7.   

    问题不是我们的程序, 问题出在SMTP 服务商。 现在反垃圾太厉害,灵敏度太高了。我也是这样的方法发过去。我发现信被直接丢进 垃圾邮件里了。 但是用大服务商的SMTP就没有这个问题,真TMD不公平! 我看现在中国的反垃圾联盟有问题。