Better not hand-deliver your own mail, folks. Just use your system's MTA to take care of the mail delivery and call out to something like send_email ($to, $subject, $body) that sends mail as the Erlang process' user. Postfix will let you use gmail as a relay host with:
relayhost = [smtp.gmail.com]:587