Configure wordpress PHPMailer to send mail via SMTP.
APACHE-2.0 License
Configure WP PHPMailer to send mail via SMTP, by defining the SMTP configuration in the wp-config.php
file.
8.0
5.8.1
-6.4.1.
WordPress
installs.env
file# Required SMTP configuration
SMTP_HOST=smtp.xxx.com
SMTP_PORT=465
[email protected]
SMTP_PASSWORD=xxxxxxxx
# Optional
[email protected]
SMTP_FROM_NAME=Bot
DISABLE_WP_PHPMAILER_SMTP=true
[email protected]
composer require andriilive/wp-phpmailer-smtp
wp-config.php
filewp-phpmailer-smtp.php
file in to mu-plugins
or plugins
dirAdd SMTP configuration to wp-config.php file
/* Required SMTP configuration */
define('SMTP_HOST', 'smtp.xxx.com');
define('SMTP_PORT', 465);
define('SMTP_USERNAME', '[email protected]');
define('SMTP_PASSWORD', 'xxxxxxxx');
/* Optional */
define('SMTP_FROM', '[email protected]'); // 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
Launch the following command in the mu-plugins
or plugins
directory
wget https://raw.githubusercontent.com/digitalandy/wp-phpmailer-smtp/main/wp-phpmailer-smtp.php -O wp-phpmailer-smtp.php