且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ASP.NET Core Mailkit

更新时间:2023-02-15 22:14:51

Microsoft Azure不允许端口25上的出站连接,并且也阻止所有出站SMTP,但连接到SendGrid(第三方SMTP提供程序)时除外.单一的Microsoft Azure的受祝福"出站电子邮件提供商.

Microsoft Azure does not allow for outbound connections on port 25 and also blocks all outbound SMTP except for when connecting to SendGrid, a third-party SMTP provider who are the single "blessed" outbound email provider for Microsoft Azure.

(我认为这很奇怪,因为您会认为Microsoft希望在Azure中炫耀其Exchange服务,并与AWS的电子邮件服务竞争)

(I think this is odd because you'd think Microsoft would want to show-off their Exchange services in Azure, as well as competing with AWS' e-mail service)

SendGrid是免费的(幸运的是,否则,这将是勒索),每月最多20,000封电子邮件,之后它们仍然非常便宜.

SendGrid is free (fortunately - otherwise that would be extortion) up to 20,000 e-mails a month, after then they're still pretty cheap.

您可以直接从Azure门户中创建一个SendGrid帐户,然后单击管理"按钮以打开您的SendGrid帐户详细信息并获取其SMTP详细信息,包括用户名和密码.

You can create a SendGrid account from within Azure Portal directly, then click the "Manage" button to open your SendGrid account details and get their SMTP details, including username and password.

SendGrid提供了两个API:第一个只是原始的哑" SMTP服务,尽管默认情况下,它们会将您的电子邮件延迟10分钟(以缓解垃圾邮件),直到您的帐户被视为受信任"为止.他们的第二个API是您可以使用的HTTP Web服务-在重载情况下更好,因为HTTP连接比SMTP连接便宜.

SendGrid offers two APIs: the first is just a raw "dumb" SMTP service, though by default they will delay your emails by 10 minutes (to mitigate spam) until your account is deemed "trusted". Their second API is a HTTP web-service you can use - this is better for heavy-load scenarios because HTTP connections are cheaper than SMTP connections.