ubuntu18.04 heirloom-mailx through an external SMTP server to send mail

Configuring source software
can not be installed directly on heirloom-mailx ubuntu18.04, you need to add the software source

sudo vi /etc/apt/sources.list
UtsushiIri

Universe xenial main http://cz.archive.ubuntu.com/ubuntu the deb
 
Heirloom-install the mailx
the sudo APT-GET Update
the sudo-APT the install the mailx Heirloom
 
arranged outside the SMTP
Ubuntu18.04 profiles for /etc/s-nail.rc , the following lines are placed in final

from = SET "[email protected]"
SET SMTP = "SMTPS: //smtp.qq.com: 465"
SET SMTP-User-the auth = "[email protected]"
SET-SMTP the auth-password = "ahkphxxabcbshabbga"
set smtp-auth = login
Note: 1. the fourth line refers to the QQ mailbox password authorization code is not a password, QQ mailbox can obtain an authorization code to view the article: https://jingyan.baidu.com/article/fedf0737af2b4035ac8977ea.html

   2.from and smtp-auth-user mailboxes to be consistent

Test
echo "mail content" | s-nail -s "message subject" [email protected]
or

s-nail -s "message subject" [email protected] <result.txt

original link: https: //blog.csdn.net/mdx20072419/article/details/103901254

Guess you like

Origin www.cnblogs.com/daofaziran/p/12403910.html