Getting one of my Drupal sites to send HTML email from a Gmail gave me more grief that I'd like to admit. The documentation for this one task seemed so scattered and unclear, it just makes sense to finally have it all in one place. Hopefully I can save a few of you some work.
First, make sure SSL has been enabled in php.ini. You'll probably have to type this line from scratch with the other extensions.