我正在尝试使用窗口凭据发送电子邮件。以下是我的代码:-
string to = "abc@host.com";
string from = "def@host.com";
MailMessage message = new MailMessage(from, to);
message.Subject = "Using the new SMTP client.";
message.Body = @"Using this new feature, you can send an email message from an application very easily.";
SmtpClient client = new SmtpClient("smtp.host.com");
client.UseDefaultCredentials = true;
try
{
client.Send(message);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
然后我收到此错误交易失败。服务器响应为:IRFRPAR-C690-06-D2-incoming.host.com