echo "From: someone1 <[email protected]" > somefile.txt
echo "To: someone2 <[email protected]>; someone3 <[email protected]>;" >> somefile.txt
echo "Subject: sometitle" >> somefile.txt
echo "" >> somefile.txt
echo "content" >> somefile.txt
- 以上信息内容可以瞎写
- echo "" >> mail.txt 空行后才能加正文
curl --ssl-reqd --url smtps://smtp.exmail.qq.com:465 --user [email protected]:password --mail-from [email protected] --mail-rcpt [email protected] --upload-file somefile.txt
curl --ssl-reqd --url smtps://smtp.exmail.qq.com:465 --user [email protected]:password --mail-from [email protected] --mail-rcpt [email protected] --mail-rcpt [email protected] --upload-file somefile.txt
- smtps服务器为腾讯企业邮箱
- 密码passwd为腾讯企业邮箱授权密码,参考:https://zhuanlan.zhihu.com/p/340376585
- somefile.txt 内容用echo "内容">> somefile.txt生成,用vim编辑不行
- --mail-from 值为真实邮箱地址
- 多个收件人就多写一次 --mail-rcpt [email protected],正文“Frome:”可以缺省对应,会不提示具体收件人someone3