k-ko/send-mail-smtp

PHPMailer 的 Shell 脚本包装器

v2.1.0 2021-12-26 10:04 UTC

This package is auto-updated.

Last update: 2024-09-26 16:23:09 UTC


README

安装

composer require k-ko/send-mail-smtp

通过您自己的 SMTP 邮件服务器安全发送电子邮件

Usage: vendor/bin/sendmail -c <config-file> [options]

Options:
        -c      Config file {required}
        -t      To: address(es), can be used multiple times
        -s      Subject
        -b      Plain text body, if starts with @ assume get from file
        -f      HTML body, if starts with @ assume get from file
        -w      CC: address(es), can be used multiple times
        -z      BCC: address(es), can be used multiple times
        -r      From: From email address, overwrites config file if given
        -a      Attachment(s); file_name[,display_name]
        -p      Priority (0|1)
        -v[vvv] PHPMailer verbosity
        -h      This help

Possible formats for emails: 'name@example.com' or 'any name <name@example.com>'
If a HTML body is set, an additional plain text body will be ignored!

所有选项都可以在配置文件中定义,并将由命令行参数覆盖。

所有电子邮件地址都可以接受为 name@example.comany name <name@example.com>"any name" <name@example.com>

详细程度级别翻译为

  • 0 - 无调试输出,默认
  • 1 - 客户端命令
  • 2 - 客户端命令和服务器响应
  • 3 - 客户端命令和服务器响应以及连接状态
  • 4 - 低级别数据输出,所有消息

消息输出到 STDERR

配置

复制 config.dist.php 并根据您的需求进行调整

$ cp vendor/k-ko/send-mail-smtp/config.dist.php email.conf.php