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.