例外:550 5.7.54 SMTP;无法在不接受的域中转发收件人 [英] EXCEPTION: 550 5.7.54 SMTP; unable to relay recipient in non-accepted domain

查看:2754
本文介绍了例外:550 5.7.54 SMTP;无法在不接受的域中转发收件人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 SmtpClient MailMessage 将.PDF文件作为电子邮件附件发送到SharePoint文档库。



我提供发件人的凭证进行身份验证,但我收到了主题中提到的例外情况。



有什么问题,我该怎么做?是否必须提供发件人帐户?



我尝试过:



 MailMessage mailSharePoint =  new  MailMessage(); 

SmtpClient smtpClientSharePoint = new SmtpClient( server30.company.local 25 );

smtpClientSharePoint.Credentials = new System.Net.NetworkCredential( glpi@company.com,密码);

smtpClientSharePoint.UseDefaultCredentials = true ;

smtpClientSharePoint.DeliveryMethod = SmtpDeliveryMethod.Network;

smtpClientSharePoint.EnableSsl = true ;

mailSharePoint.From = new MailAddress( glpi@company.com 将文件保存到SharePoint) ;

mailSharePoint.To.Add( new MailAddress( fdf@server25.company.local));

mailSharePoint.Subject = 将文件保存到SharePoint + myModel.id_fdf_offers ;

mailSharePoint.Attachments.Add( new 附件(Server.MapPath( 〜/ TEMPLATE / + FileName + 。pdf )));

smtpClientSharePoint.Send(mailSharePoint);

解决方案

您需要联系管理您正在使用的smtp服务器的人(server30.company.local)和告诉他们你想从company.com域中继并遵循他们的建议。他们可能会说你不能,他们可能能够配置他们的服务器以允许这个,他们可能会给你一套特殊的凭证,你可以使用。我们不是该服务器的管理员,因此无法告诉您将会发生什么。


SMTP提供商(在您的示例company.com中)很可能设置了SPF。这是一件好事和好事。



什么是SPF? 发件人策略框架(SPF)是一个简单的电子邮件验证系统,旨在通过提供一种机制允许接收邮件交换器检查来自域的传入邮件是否来自该域管理员授权的主机来检测电子邮件欺骗



在您的情况下,发件人(From)是glpi@company.com,发送电子邮件的主机/域是server30.company.local。然后政策启动并说,嘿server30.company.local不允许/允许代表company.com发送电子邮件。失败了。您可能需要联系管理员以允许server30.company.local域使用company.comSMTP发送电子邮件。



政策框架 - 维基百科 [ ^ ]



如何更新/设置SPF

在Office 365中设置SPF以帮助防止欺骗:Exchange Online帮助 [添加SPF记录|域名 - GoDaddy帮助CA [ ^ ]

I am sending a .PDF file as an Email attachment to a SharePoint document library using SmtpClient and MailMessage.

I provide the credentials of the sender for authentication but yet I am getting the exception mentioned in the subject.

What is wrong and what can I do instead? Is it mandatory to provide a sender account?

What I have tried:

MailMessage mailSharePoint = new MailMessage();

SmtpClient smtpClientSharePoint = new SmtpClient("server30.company.local", 25);

smtpClientSharePoint.Credentials = new System.Net.NetworkCredential("glpi@company.com", password);

smtpClientSharePoint.UseDefaultCredentials = true;

smtpClientSharePoint.DeliveryMethod = SmtpDeliveryMethod.Network;

smtpClientSharePoint.EnableSsl = true;

mailSharePoint.From = new MailAddress("glpi@company.com", "Save file To SharePoint");

mailSharePoint.To.Add(new MailAddress("fdf@server25.company.local"));

mailSharePoint.Subject = "Save file to SharePoint " + myModel.id_fdf_offers;

mailSharePoint.Attachments.Add(new Attachment(Server.MapPath("~/TEMPLATE/" + FileName + ".pdf")));

smtpClientSharePoint.Send(mailSharePoint);

解决方案

You need to contact whoever administers the smtp server you are using ("server30.company.local") and tell them you want to relay from the company.com domain and follow their advice. They might flat out say you can't, they might be able to configure their server to allow this, they might give you a special set of credentials you can use. We are not the administrator for that server so can't tell you what will happen.


Very likely the SMTP provider (in your example company.com) has SPF setup. Which is a good and beautiful thing.

What is SPF? "Sender Policy Framework (SPF) is a simple email-validation system designed to detect email spoofing by providing a mechanism to allow receiving mail exchangers to check that incoming mail from a domain comes from a host authorized by that domain's administrators"

In your case, the originator (From) is "glpi@company.com" and the host/domain that send the email is "server30.company.local". Then the policy kick in and said, hey "server30.company.local" is not permitted/allow to send email on behalf of "company.com". Failed it. You might need to contact the Administrator to allow the "server30.company.local" domain to use "company.com" SMTP to send email.

Sender Policy Framework - Wikipedia[^]

How to update/set SPF
Set up SPF in Office 365 to help prevent spoofing: Exchange Online Help[^]
Add an SPF record | Domains - GoDaddy Help CA[^]


这篇关于例外:550 5.7.54 SMTP;无法在不接受的域中转发收件人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆