tail -5 /etc/mail.rc #加上这几行,代表用我这个账号登陆邮件去发送消息
set [email protected]
set smtp=smtp.126.com
set [email protected]
set smtp-auth-password=123456
set smtp-auth=login
发送邮件命令
1、使用管道进行邮件发送
echo "hello" | mail -s "Hello from mzone.cc by pipe" [email protected]
cat "test.cfg" | mail -s "Hello from mzone.cc by pipe" -c "[email protected] [email protected]"[email protected]
-c前面是抄送人,后面是收件人
2、使用文件进行邮件发送
mail -s "Hello from mzone.cc by file" [email protected] < mail.txt
时间: 2024-12-19 11:45:05