日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

mail、sendEmail发送邮件命令

發布時間:2025/3/15 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mail、sendEmail发送邮件命令 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

申請臨時郵箱地址

  • https://blog.csdn.net/u012206617/article/details/104632026

?

Centos

centos自帶mail工具

安裝mail

  • yum -y install mailx

配置發送人帳號信息

  • vim /etc/mail.rc
  • 在最后加兩行代碼
    • set from=123456@163.com smtp=smtp.163.com
    • set smtp-auth-user=123456@163.com smtp-auth-password=666666 smtp-auth=login

?

Ubuntu

安裝mail

  • apt-get install heirloom-mailx

配置發送人賬戶信息

  • vim /etc/s-nail.rc 或?/nail.rc(本人是/etc/s-nail.rc)
  • 在最后增加兩行代碼
    • set from=123456@163.com smtp=smtp.163.com
    • set smtp-auth-user=123456@163.com smtp-auth-password=666666 smtp-auth=login

?

mail工具使用

讀取文件內容發送

  • mail -s "主題" 郵箱地址?< path/filename

管道形式發送

  • echo "郵件內容" | mail -s "主題" 郵箱地址

給多個用戶發送郵件

  • mail -s test -c?admin@aispider.com ?root@aispider.com< file

發送附件郵件

  • yum?install?sharutils 或 apt-get install?sharutils
  • uuencode /home/zhousir/httpd.conf httpd.conf|mail -s mailtest 123@qq.com
  • tar czf - /home/zhousir/ | uuencode home.tgz |mail -s mailtest 123@qq.com
  • uuencode?test.txt?test?|?mail?-s?"hello,see?the?attachement"?123@qq.com?< mail.txt?

?

sendEmail工具使用

安裝

  • apt-get install sendemail?

發送內容

  • sendEmail -f 123@163.com -t 123@qq.com -s smtp.163.com -u "主題測試" -o message-content-type=html -o message-charset=utf-8 -o tls=no -xu 123@163.com -xp 123 -m "郵件內容"

發送多人

  • sendEmail -f 123@163.com -t 123@qq.com 456@qq.com -s smtp.163.com -u "主題測試" -o message-content-type=html -o message-charset=utf-8 -o tls=no -xu 123@163.com -xp 123 -m "郵件內容"

發送抄送人

  • sendEmail -f 123@163.com -t 123@qq.com -cc 456@qq.com -s smtp.163.com -u "主題測試" -o message-content-type=html -o message-charset=utf-8 -o tls=no -xu 123@163.com -xp 123 -m "郵件內容"

發送附件

  • sendEmail -f 123@163.com -t 123@qq.com -s smtp.163.com -u "主題測試" -o message-content-type=html -o message-charset=utf-8 -o tls=no -xu 123@163.com -xp 123 -m "郵件內容" -a ./abc.txt
新人創作打卡挑戰賽發博客就能抽獎!定制產品紅包拿不停!

總結

以上是生活随笔為你收集整理的mail、sendEmail发送邮件命令的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。