「メールを送信できません」例外。内部の例外は「リモートサーバーに接続できません」であり、その内部例外は「接続されたパーティが一定期間後に正しく応答しなかったか、接続されたホストが応答しなかったため接続が失敗したため接続に失敗しました"私は、これがファイヤーウォールの設定ではないのは確かだと確信しています。誰も私がそれについて何ができるか知っていますか?ありがとう。Google SMTP経由でメールを送信できません
var mail = new MailMessage("[email protected]", "[email protected]")
{
Subject = "Testing subject",
Body = "Testing body"
};
try
{
var client = new SmtpClient("smtp.google.com", 465)
{
EnableSsl = true,
Credentials = new NetworkCredential("[email protected]", "password")
};
client.Send(mail);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
ええ、それはポート587だったはずです。今はうまくいきます。ありがとう。 – jonakrob