在本地测试成功发送了邮件,传上服务器测试,失败了,在返回本地测试,也失败了!
错误:
System.Net.Mail.SmtpFailedRecipientsException: Unable to send to all recipients. ---> System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Access not allowed --- End of inner exception stack trace --- at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at MailList.Send(String[] mailAddresses, String mailSubject, String mailContent) at admin_SendUpdates.ButtonSend_Click(Object o, EventArgs e) 非常的郁闷,搞了一天,试过把SmtpClient对象smtp设置为:smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;会出现Cannot get IIS pickup directory错误。
这不是关键,关键是:为什么在本地测试,有时候可以,有时候出错?测试过两个mail server,一个是公司的,一个是sina.com,都是一样的情况。有人遇到过这样的情况吗?
错误:
System.Net.Mail.SmtpFailedRecipientsException: Unable to send to all recipients. ---> System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Access not allowed --- End of inner exception stack trace --- at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at MailList.Send(String[] mailAddresses, String mailSubject, String mailContent) at admin_SendUpdates.ButtonSend_Click(Object o, EventArgs e) 非常的郁闷,搞了一天,试过把SmtpClient对象smtp设置为:smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;会出现Cannot get IIS pickup directory错误。
这不是关键,关键是:为什么在本地测试,有时候可以,有时候出错?测试过两个mail server,一个是公司的,一个是sina.com,都是一样的情况。有人遇到过这样的情况吗?
四台电脑上网页报的错都不一样.
真无敌
用应用程序在服务器上测试同样代码,发送成功。但是在aspx上就不行。异常详细信息: System.Net.Mail.SmtpException: 无法获取 IIS 拾取目录。