发送邮件的问题
今天跟着书写了一个发送电子邮件的页面
在web.config里加入
<system.net>
<mailSettings>
<smtp deliveryMethod="Network"
from="lefthook < h374957176@gmail.com>">
<network enableSsl="true" host="smtp.gmail.com" userName="h374957176@gmail.com" password="mima"/>
</smtp>
</mailSettings>
</system.net>
page_load里面加入
MailMessage myMessage = new MailMessage();
myMessage.Subject = "Test Message";
myMessage.Body = "Hello World, from Planet Wrox";
myMessage.From = new MailAddress("h374957176@gamil.com", "h374957176");
myMessage.To.Add(new MailAddress("lefthook@163.com", "lefthook"));
SmtpClient mySmtpClient = new SmtpClient();
mySmtpClient.Send(myMessage);
这个代码用gmail给163发邮件收到了。
我换了一下用163给gmail发邮件结果收到了退信
发送的信件被对方服务器拒绝。
英文说明:SMTP error, RCPT TO: 550 5.1.1 : Recipient address rejected: User unknown in virtual alias table.(SMTP error, RCPT TO: 550 5.1.1 <h374957176@gamil.com>: Recipient address rejected: User unknown in virtual alias table)
这个是什么原因啊?
------解决方案--------------------
http://www.iq38.com/51562.html