文档

SMTP 之 Perl 调用示例

更新时间:
一键部署

使用 Perl 通过 SMTP 协议发信

  1. # Swaks is an smtp of CURL, install it first:
  2. curl http://www.jetmore.org/john/code/swaks/files/swaks-20130209.0/swaks -o swaks
  3. # Set the permissions for the script so you can run it
  4. chmod +x swaks
  5. # It's based on perl, so install perl
  6. sudo apt-get -y install perl
  7. # now send!
  8. ./swaks --auth \
  9. --server smtpdm.aliyun.com \
  10. --au domaintest@dm.aliyun.com \
  11. --ap ***** \
  12. --from domaintest@dm.aliyun.com \
  13. --to test@test.com \
  14. --reply-to 自定义回信地址 \
  15. --h-Subject: "Hello" \
  16. --body 'Testing mail!'

注:请在 —au 后替换发信地址;—ap 后替换 SMTP 密码;—from后替换发信地址;—to 后替换收信地址。

  • 本页导读 (0)
文档反馈