I recently got involved in a project that required sending email alerts, and knew very little going in about the ins and outs of socket programming under Windows, let alone how to send an email without recourse to Outlook Express.
To say that it took some research is an understatement.
As it turns out, you can send email through Telnet. Now, that's out of the scope of this little introduction to SMTP and WinSock programming, but it is a great starting point. If you ever need to check what a server can do, basic Telnet is a great way to find out.
So, with that in mind, a quick delve into the world of WinSock programming made it clear that it requires (a) getting an IP address from a server name (mail.yourisp.com), (b) connect it to a socket, and (c) dialoging with the server.
The exact nature of the dialog depends on the server in question. For an SMTP server, there are commands to authenticate with the server, with username and password, prepare a message with email addresses, subject line, and body.
Having fought with the documentation available on the Internet, and played around Telnetting to mail servers for a few hours, I decided to help out my fellow programmers and write it up.
The article in question can be found here : computer-programming-tutorials.suite101.com/article.cfm/sending_email_with_smtp_auth
Have fun!