【发布时间】:2018-01-12 00:16:12
【问题描述】:
我已尝试使用我的客户从地址 (info@myclient.com) 向我客户的客户发送电子邮件。 我的客户已经通过 SPF 将我的 smtp 服务器配置到他们的域中。 以下是为发送电子邮件而编写的 C# 代码。
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress("info@mycient.com");
mail.To.Add("krishna.menan@gmail.com");
mail.Subject = "This is an email";
mail.Body = "this is a sample body with html in it. <b>This is bold</b>
<font color=#336699>This is blue</font>";
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
System.Net.NetworkCredential networkCredentialRFE = new
System.Net.NetworkCredential("kirshna@mycomapny.com", "Password123");
smtp.Credentials = networkCredentialRFE;
smtp.Host = "outlook.office365.com";
smtp.EnableSsl = true;
smtp.Port = 587;
smtp.Send(mail);
以下是我得到的错误: 信箱不可用。服务器响应为:5.7.60 SMTP;客户端无权作为此发件人发送
【问题讨论】:
标签: c# email office365 exchange-server