Amazon SES サービスを使用してメールを送信しようとしています。私のコードは彼らのドキュメントから取られています:
public static void SendWithSMTP(string username, string password, string host, int port)
{
using (var client = new System.Net.Mail.SmtpClient(host, port))
{
client.Credentials = new System.Net.NetworkCredential(username, password);
client.EnableSsl = true;
client.Send("from@example.com", "to@example.com", "This is a test subject.", "This is a test email message body.");
}
問題は、次の例外が発生することです。
SMTP サーバーが安全な接続を必要としているか、クライアントが認証されていません。サーバーの応答は次のとおりでした: 認証が必要です
同じまたは類似の問題を抱えている人はいますか?この問題に関する提案はありますか?