[英]Register and use User's email domain
In my current application i want to add a new feature that customers will be able to register their own email domain server if they have any. 在我当前的应用程序中,我想添加一个新功能,即客户可以注册自己的电子邮件域服务器。 Currently i am sending all emails using my own application domain.
目前,我正在使用自己的应用程序域发送所有电子邮件。
I want to know how we can accomplish that using ASP.NET WebApi & C# that user will allow to validate and register their own email domains instead of using the default one. 我想知道我们如何使用ASP.NET WebApi和C#来实现这一点,用户将允许其验证和注册自己的电子邮件域,而不是使用默认域。
Do we need user's DKIM and SPF records ? 我们需要用户的DKIM和SPF记录吗?
Then you don't need to look at DKIM and SPF records. 然后,您无需查看DKIM和SPF记录。 The user should do that himself.
用户应该自己做。
You will have to collect from the user: 您必须向用户收集:
Then the user will have to add a DKIM entry and update the SPF entry on their domain name. 然后,用户将必须添加DKIM条目并更新其域名上的SPF条目。 You will have to provide the values to your user depending on your email service.
您将必须根据您的电子邮件服务向用户提供值。
You can take inspiration from all those services that allow the same kind of feature ( mailchimp , mandrill , postmarkapp , zoho ...). 你可以采取的灵感来自所有这些服务,让同一种功能( mailchimp , 山魈 , postmarkapp , ZOHO ...)。
In both cases, you can use a DNS client to verify the DNS records are OK. 在这两种情况下,您都可以使用DNS客户端来验证DNS记录是否正常。 You will be able to tell the user whether records are missing.
您将能够告诉用户记录是否丢失。
Here a sample code to start checking the SPF record with ARSoft.Tools.Net . 这里是一个示例代码,用于开始使用ARSoft.Tools.Net检查SPF记录。
var client = new DnsClient(servers, 10000);
var spfRecords = client.Resolve(item.Name, RecordType.Txt);
if (result.AnswerRecords == null || result.AnswerRecords.Count == 0 || result.ReturnCode == ReturnCode.NxDomain)
{
// spf record is missing
}
else if (result.AnswerRecords.Count == 1)
{
// check the record value with SpfRecord.TryParse(item.ActualValue, out spf)
}
else
{
// too many spf records
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.