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

前端 未结 5 2052
走了就别回头了
走了就别回头了 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:34

    Is port 25 enabled and available? For example this thread explains that is is possible for another service to have exclusive access to it.

    Have you tried this code in another machine (with less security)? I don't mean that as part of a fix, but just to make sure that the code is OK by itself.

提交回复
热议问题