mailx mail client to send mail

First, install mailx mail client:
yum -y install mailx

Second, modify /etc/mail.rc configuration file:

Verify the ignore-SSL = SET
SET-config-NSS the dir = / the root / .certs
SET [email protected]
SET SMTP = SMTPS: //smtp.qq.com: 465
SET SMTP the auth-User-ABC @ QQ = .com
SET-SMTP the auth = QQ-mail password authorization code
set smpt-auth = login

三、配置证书:
mkdir -p /root/.certs/
echo -n | openssl s_client -connect smtp.qq.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/qq.crt
certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt
certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt
certutil -L -d /root/.certs

Fourth, obtain authorization code in their own qq-mail:
mailx mail client to send mail

Copy the generated authorization code attached to a second step set smtp-auth-password = to.

Fifth, and finally sending mail:
echo "i AM Victor chen, hi" | mail -s -v "say the Hello" [email protected]

Guess you like

Origin blog.51cto.com/victor2016/2402004