Can I test SmtpClient before calling client.Send()?

前端 未结 6 786
夕颜
夕颜 2020-11-28 10:58

This is related to a question I asked the other day on how to send email.

My new, related question is this... what if the user of my application is behind a firew

6条回答
  •  时光说笑
    2020-11-28 11:59

    You could try to send an HELO command to test if the server is active and running before to send the email. If you want to check if the user exists you could try with the VRFY command, but this is often disabled on SMTP servers due to security reasons. Further reading: http://the-welters.com/professional/smtp.html Hope this helps.

提交回复
热议问题