FIXME: something wrong
References
- Mac OS X 下用命令行发送邮件 : https://my.oschina.net/uhziel/blog/186683
- msmtp - documentation : https://marlam.de/msmtp/documentation
An SMTP client
See man msmtp
for more
brew install msmtp
Create file ~/.mailrc
& append configs to it as below
set sendmail=/usr/local/bin/msmtp
Create file ~/.msmtprc
& append configs to it as below
- Replace PASSWORD with your real password
- Replace [email protected] with your real email address
# Use an external SMTP server with insecure authentication.
# (manually choose an insecure authentication method.)
# Note that the password contains blanks.
defaults
####################################################################
# A sample configuration using QQMail
####################################################################
# account name is "qqmail".
# You can select this account by using "-a qqmail" in your command line.
account qqmail
host smtp.qq.com
tls on
tls_certcheck off
port 465
auth login
from [email protected]
user [email protected]
password PASSWORD
# If you don't use any "-a" parameter in your command line,
# the default account "qqmail" will be used.
account default: qqmail
# e.g.
echo "CONTENT" | mailx -s "SUBJECT" [email protected],[email protected]
mail -s
# or
mail