Recently we needed to get a project working where action mailer needed to communicate with gmail. After hunting around on the web for a couple of minutes we came across an excellent post by Stephen Chu. This example gives developers a pure ruby way of working with the gmail server without needing to install a secondary email server like msmtp as it is described in this how to article.
One thing to note.. In his example code he states to use ActionMailer::Base.server_settings. In order to get this working I had to change this to ActionMailer::Base.smtp_settings.
Thanks for the great work Stephen.