#send-email #tool #command #body #smtp-server #user-name #subject

app send-mail

发送电子邮件命令工具

2个版本

0.1.1 2023年3月24日
0.1.0 2023年3月24日

291电子邮件 类别中

每月27 次下载

MIT/Apache

15KB
96 代码行

发送电子邮件

  • 帮助
$send-mail --help
Usage: send-mail [OPTIONS] --subject <SUBJECT> --body <BODY>

Options:
  -s, --smtp-server <SMTP_SERVER>
          smtp server host
  -u, --username <USERNAME>
          smtp username
  -p, --password <PASSWORD>
          smtp password
  -f, --from <FROM>
          from [name:email] (name:[email protected])
  -t, --to <TO>
          to [name:email|name:email|..] (name1:[email protected]|name2:[email protected]|...)
      --subject <SUBJECT>

      --body <BODY>
          body
      --body-html <BODY_HTML>
          html body
  -a, --attachment-file <ATTACHMENT_FILE>
          attachment file path
  -h, --help
          Print help
  • 环境
export SMTP_SERVER=smtp.xxx.xx
export MAIL_USERNAME=xxxxxx
export MAIL_PASSWORD=xxxxxx
export MAIL_FROM=name:[email protected]
export MAIL_TO=name1:[email protected]|name2:[email protected]|...

send-mail --subject "subject" --body "body" --body-html "<h1>body html</h1>" --attachment-file attachment-file 

依赖关系

~12–26MB
~421K SLoC