Last active
July 16, 2022 06:39
S-nail $HOME/.mailrc for Gmail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You should replace USER and PASSWORD. | |
# PASSWORD is plain text. So you should set appropriate permissions with chmod 0600. | |
account gmail { | |
set v15-compat | |
set mta=smtp://USER:PASSWORD@smtp.gmail.com:587 smtp-use-starttls | |
} |
Currently, PASSWORD should be 'App Password'. Google account password does not work.
The followings show how to setup App Password.
https://web.archive.org/web/20220716063430/https://docs.3rdeyesys.com/etc/etc_smtp_auth_to_google_gmail_account.html
https://archive.ph/KNMr5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following command is a example to send a mail to foo@bar.com. "-vv" is optional for verbosity.
$ echo testbody | mailx -vv -A gmail -s testsubject foo@bar.com