andriilive/wp-phpmailer-smtp

配置 wordpress PHPMailer 通过 SMTP 发送邮件。

安装: 2

依赖: 0

建议: 0

安全: 0

星标: 1

关注者: 1

分支: 0

开放问题: 0

类型:wordpress-plugin

dev-main 2024-09-02 14:26 UTC

This package is auto-updated.

Last update: 2024-10-02 14:45:20 UTC


README

StandWithUkraine  GitHub @andriilive

通过在 wp-config.php 文件中定义 SMTP 配置来配置 WP PHPMailer 通过 SMTP 发送邮件。

  • 需要至少 PHP 8.0
  • 在 WP 5.8.1-6.4.1 上测试过
  • 支持 Bedrock WordPress 安装

Bedrock 安装

  1. 编辑 .env 文件
  2. 通过 composer 需求此包
# Required SMTP configuration
SMTP_HOST=smtp.xxx.com
SMTP_PORT=465
SMTP_USERNAME=bot@digitalandy.eu
SMTP_PASSWORD=xxxxxxxx

# Optional
SMTP_FROM=bot@digitalandy.eu
SMTP_FROM_NAME=Bot
DISABLE_WP_PHPMAILER_SMTP=true
SMTP_REPLY_TO=hi@digitalandy.eu
composer require andriilive/wp-phpmailer-smtp

手动安装

  1. 编辑 wp-config.php 文件
  2. wp-phpmailer-smtp.php 文件放入 mu-pluginsplugins 目录

wp-config.php

将 SMTP 配置添加到 wp-config.php 文件中

/* Required SMTP configuration */
define('SMTP_HOST', 'smtp.xxx.com');
define('SMTP_PORT', 465);
define('SMTP_USERNAME', 'bot@digitalandy.eu');
define('SMTP_PASSWORD', 'xxxxxxxx');

/* Optional */
define('SMTP_FROM', 'bot@digitalandy.eu'); // From email
define('SMTP_FROM_NAME', 'Bot'); // From name
define('DISABLE_WP_PHPMAILER_SMTP', true); // Disable WP PHPMailer SMTP
define('SMTP_REPLY_TO', ''); // Adds reply-to header

下载 wp-phpmailer-smtp.php

mu-pluginsplugins 目录中运行以下命令

wget https://raw.githubusercontent.com/digitalandy/wp-phpmailer-smtp/main/wp-phpmailer-smtp.php -O wp-phpmailer-smtp.php