这次做的一个项目中 有一个邮件发送的功能 我使用的是.net 的mail 来发送 ,由于客户是配置的exchange邮件系统,每次用mail smtp 发送邮件 exchange里面配置的邮件地址能发送成功,exchange以外的邮件地址 就要报错 mailbox unavailable. the server response was 5.7.1 unable to relay for [email protected].
请问大家有什么解决提示没有。
请问大家有什么解决提示没有。
可以先将邮箱在outlook里使用,看看能否发送,如果能发送,再对比代码和outlook里设置时有哪些没设置到的东东,比如:有些需要SSL加密的,有的则不需要.
using Microsoft.Office.Interop.Outlook;namespace GMService {
class Program {
static void Main() {
Application app = new Application();
NameSpace ns = app.GetNamespace("mapi");
ns.Logon("jim", "password", false, true);
MailItem message = (MailItem) app.CreateItem(OlItemType.olMailItem);
message.To = "[email protected]";
message.Subject = "A simple test message";
message.Body = "This is a test. It should work";
message.Send();
ns.Logoff();
Console.Read();
}
}
}
UUUUUUUUUP!