2017-08-04 22 views
0

我試圖用我的客戶的地址([email protected])向我的客戶的客戶發送電子郵件。 和我的客戶已經通過SPF將我的smtp服務器配置到他們的域中。 以下是用於發送電子郵件的C#代碼。不允許代表我的客戶在office365上發送電子郵件

MailMessage mail = new MailMessage(); 
//set the addresses   
mail.From = new MailAddress("[email protected]"); 
mail.To.Add("[email protected]"); 
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("[email protected]", "Password123"); 
    smtp.Credentials = networkCredentialRFE; 
smtp.Host = "outlook.office365.com"; 
smtp.EnableSsl = true; 
smtp.Port = 587; 
smtp.Send(mail); 

以下是我收到的錯誤: 郵箱不可用。服務器響應是:5.7.60 SMTP;客戶端無權發送此發件人

回答

相關問題