Setting up SMTP with gmail
SMTP client library

Prev:send-email ( email -- )


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).
If the account does not use 2-step verification, Gmail requires explicitly allowing access to less secure apps. Visit https://www.google.com/settings/security/lesssecureapps to turn it on. More info: https://support.google.com/accounts/answer/6010255?hl=en.
If the account does use 2-step verification, Gmail requires the use of application-specific passwords. Visit https://security.google.com/settings/security/apppasswords to create a password for use with Factor. More info: https://support.google.com/accounts/answer/185833?hl=en.


Examples
USING: smtp namespaces io.sockets ; default-smtp-config "smtp.gmail.com" 587 <inet> >>server t >>tls? "my.gmail.address@gmail.com" "qwertyuiasdfghjk" <login-auth> >>auth \ smtp-config set-global