私は青信号を初めて利用しています。私のASP .NET MVCアプリケーションは、紺碧でホストされています。このアプリケーションには電子メール送信機能があります。アプリケーションが紺色に移動すると、電子メール機能は機能しません。私のエラーは、以下のように表示され、エラーをログに記録:誰も私がこの問題を解決するために助けてください電子メール SMTP電子メール送信で問題が発生しました。AzureでホストされているASP .Net mvcアプリケーション
SmtpClient client = new SmtpClient(GetStringValue(EMAIL_CLIENT), GetIntValue(EMAIL_PORT))
{
Credentials = new NetworkCredential(GetStringValue(EMAIL_USER_NAME), GetStringValue(EMAIL_PASSWORD)),
EnableSsl = sslOn
};
client.Host = SettingsManager.GetStringValue("EmailClient");//smtp.gmail.com
client.Port = SettingsManager.GetIntValue("EmailPort");//587
client.DeliveryMethod = SmtpDeliveryMethod.Network;
を送信するために使用
System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. a65sm9218660oih.6 - gsmtp
at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode)
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
コードブロックを。ありがとうございました。
gmail smtpを使用していますか? – ViVi
はい。私はGmailのSMTPを使用しています。 –
ViViありがとうございました。私はあなたの答えに従った。今は別の例外をスローします。 System.Net.Mail.SmtpException:メールの送信に失敗しました。 ---> System.IO.IOException:トランスポート接続からデータを読み取れません:net_io_connectionclosed –