Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apt-get install ssmtp mailutils
- rm -r /etc/ssmtp/ssmtp.conf
- nano /etc/ssmtp/ssmtp.conf
- GMAIL CONFIG
- ***********************************************
- # The user that gets all the mails (UID < 1000, usually the admin)
- root=noreply@xxxxxxxxxxxxxxx
- # The mail server (where the mail is sent to), both port 465 or 587 should be acceptable
- # See also https://support.google.com/mail/answer/78799
- mailhub=smtp.gmail.com:587
- # The address where the mail appears to come from for user authentication.
- rewriteDomain=gmail.com
- # The full hostname
- hostname=localhost
- # Use SSL/TLS before starting negotiation
- UseTLS=Yes
- UseSTARTTLS=Yes
- # Username/Password
- AuthUser=xxxxxxxxxxxxxxxxxxxxx
- AuthPass=xxxxxxxxxxxxxx
- AuthMethod=LOGIN
- # Email 'From header's can override the default domain?
- FromLineOverride=yes
- ***********************************************
- add
- root:xxxxx@gmail.com:smtp.gmail.com:587
- youruser:xxxxxx@gmail.com:smtp.gmail.com:587
- ******IMPORTANT****
- send-mail: Authorization failed
- Take the step mentioned earlier.
- Log into your google email account and then go to this link: https://www.google.com/settings/security/lesssecureapps and set "Access for less secure apps" to ON.
- Test to see if your issue is resolved. If it isn't resolved, as it wasn't for me, continue to Step #2.
- https://accounts.google.com/b/0/DisplayUnlockCaptcha
- echo test | mail -v -s "testing ssmtp setup" xxxxxxxxxxxxx@gmail.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement