我正在使用ASP.NET Web表单并通过我们的SMTP电子邮件系统发送自动电子邮件。在我的web.config我添加了这个:SMTP异常5.7.1
<mailSettings>
<smtp from="[email protected]">
<network host="111.111.1.1" port="25" defaultCredentials="true" />
</smtp>
</mailSettings>
现在我写此代码发送电子邮件:
MailMessage message = new MailMessage();
message.From = new MailAddress("[email protected]");
message.To.Add(new MailAddress("[email protected]"));
message.CC.Add(new MailAddress("[email protected]"));
message.Subject = "Testing";
message.Body = bodymessage;
SmtpClient client = new SmtpClient();
client.Send(message);
在最后一行我得到这个错误MESG:
{“邮箱不可用。服务器响应是:5.7.1客户端不具有 有权发送此发件人为 发件人}}
这里有什么问题?
与您的邮件服务器管理员进行交谈 - 显然,您需要对发件人地址或其他限制进行限制,以便您调整代码。 – Joe 2011-06-01 17:04:07