2017年9月27日 星期三

Linux curl 指令使用 (特別針對Mail)


  • Send Mail
curl --url 'smtp://smtp.gmail.com' -v --mail-from 'user1@example.com.tw' --mail-rcpt 'user2@gmail.com' --upload-file mail.txt

curl --url 'smtp://smtp.gmail.com' -v --mail-from 'user1@example.com.tw' --mail-rcpt 'user2@gmail.com' --upload-file mail.txt --user 'marry:1234'

Gmail Example:
curl --url 'smtps://smtp.gmail.com:465' --ssl-reqd --mail-from 'user1@gmail.com' --mail-rcpt 'user1@gmail.com' --upload-file mail.txt --user 'user1@gmail.com:user1pwd' --insecure

  • List Mail
curl pop3://marry:1234@172.16.166.160/ --list-only
curl pop3s://marry:1234@172.16.166.160/ -list-only --ssl-reqd --insecure

  • Retrive First Mail
curl pop3://marry:1234@172.16.166.160/1

  • Delete First Mail
curl pop3://marry:1234@172.16.166.160/1 --request dele --list-only

沒有留言:

張貼留言