I cannot help you with PHPMailer because I do not use it.
But you can use the MIME message class that I wrote and works better when sending message via SMTP to Gmail. Take a look at the test_smtp_message.php script and adjust the configuration variables as described in the comments to send via Gmail.
phpclasses.org/mimemessage
You also need these two packages for authenticantion:
phpclasses.org/sasl
and this SMTP class:
phpclasses.org/smtpclass