I love dylansweb's answer because it discusses the fact that you need to have access to an SMTP server. However, to connect to it you will need a client library. Recently, I too needed to send an email programmatically, albeit in python - not C#. I brought up an SMTP server on my own computer, however, it was unsuccessful transporting an email. I don't know why it didn't work. Perhaps the server wasn't actually on the internet, for which it would need a publicly accessible IP address - not just a home network IP? I decided to go with Google's server, and I got it to work! Please note that to log into my gmail account to send the email, I had to set up an app password.