If you plan to send all email from the same address, then setting the config variable in the global namespace is the best option. The code example below does this approach and is meant to go in your Bootstrap initialization file.
First, we set the login and password to a <login-auth> tuple with our login. Next, we set the gmail server address with an <inet> object. Finally, we tell the SMTP library to use a secure connection.
Notes Observed on 2016-03-02: Gmail has restrictions for what they consider "less secure apps" (these include the factor smtp client).