我有一个在Azure App Services上运行的应用程序。到目前为止,我一直使用Gmail SMTP服务器发送电子邮件,并且它一直很好用。电子邮件服务类似于文档中描述的配置如下:
"ApplicationEmail": {
"EmailAddress": "template@gmail.com",
"Password": "temppassword",
"SmtpClient": "smtp.google.com",
"Port": "587",
"SSL": "true"
}
现在我正在尝试切换到ProtonMail服务器,我在那里有一个带有自定义域名的账户,最终,我尝试按照以下方式重新配置设置:
"ApplicationEmail": {
"EmailAddress": "administration@mydomain.de",
"Password": "randompassword",
"SmtpClient": "smtp.protonmail.com",
"Port": "587",
"SSL": "true"
}
当然这行代码是无效的,当我尝试发送邮件时出现了这个错误。
System.Net.Mail.SmtpException: Failure sending mail.
System.Net.Sockets.SocketException (11001): No such host is known.
我到处寻找解决方案,唯一的方法是安装在后台运行并加密和解密电子邮件的ProtonBridge,但那似乎不是一个选项,因为我无法将其集成到Azure App Service中,因为它类似于PaaS而不是Azure虚拟机。如果我错了,请不要苛刻评判,因为我对C#、Azure相对较新 :)