简体   繁体   English

注册并使用用户的电子邮件域

[英]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 ? 我们需要用户的DKIMSPF记录吗?

If the user provides the credentials to their own email service 如果用户将凭据提供给自己的电子邮件服务

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: 您必须向用户收集:

  • email service type (smtp, mandrill, postmarkapp...) 电子邮件服务类型(smtp,mandrill,postmarkapp ...)
  • email service host name (if smtp) 电子邮件服务主机名(如果是smtp)
  • credentials or api key 凭证或api密钥
  • and maybe service-specific options 以及特定于服务的选项

If you use your own service to send emails 如果您使用自己的服务发送电子邮件

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山魈postmarkappZOHO ...)。

Check for DNS email records 检查DNS电子邮件记录

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.

相关问题 注册站点用户并发送电子邮件 - Register Site User and Send Email 将[授权]属性与用户的电子邮件一起使用 - Use [Authorize] attribute with user's email 如何注册将验证域用户的 HttpClient - How to register HttpClient that will authenticate domain user 选择用于发送电子邮件的域帐户 - choosing which domain account to use for sending email System.Net.Mail-无法向用户发送电子邮件-收到“交易失败:服务器响应为[此处为域名]”错误消息 - System.Net.Mail - Unable to email user(s) - getting “Transaction Failed: The Server Response was [domain name here]” error message 如何通过用户名和密码注册用户并通过会员身份确认密码和电子邮件? - How to register user by username and password and confirm password and email by membership? 登录到域A,然后将域A的cookie用于域B - Log in to domain A then use domain A's cookies for domain B 如何在linqToTwitter中通过用户的屏幕名称获取用户的电子邮件? - How To get User's email by user's screen name in linqToTwitter? 获取广告组用户的电子邮件 - Get AD Group User's email 获取登录用户的电子邮件地址并将其传递给电子邮件 - Get logged in user's email address and pass it in an email message
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM