How to access smtp.gmail.com or other to send email

This link has the code I use.

It reads and displays the email server response after each send so you will know if it is working, and why if not.

edit: If you do not have a commercial account with a static ip, you may be blocked by the gmail server.