What caused the Socket Exception while sending email from Console application?

前端 未结 5 2085
走了就别回头了
走了就别回头了 2021-01-17 17:41

I\'m trying to write a basic console app that will send an email. The problem is that I keep getting the Socket exception:

An attempt was made to acc

5条回答
  •  轮回少年
    2021-01-17 18:14

    Try to play with EnableSsl. In msdn reason of exception:

    EnableSsl is set to true, but the SMTP mail server did not advertise STARTTLS in the response to the EHLO command.

    Also check StatusCode of the exception.

提交回复
热议问题