- Install and activate the
smtp-config.php
file as a plugin or drop it in/mu-plugins
. - Define the necessary constants in
wp-config.php
.
Route email through MailHog without authentication.
<?php
define( 'CEDARO_SMTP_HOST', 'localhost:1025' );
Send email using SparkPost.
<?php
define( 'CEDARO_SMTP_HOST', 'tls://smtp.sparkpostmail.com:587' );
define( 'CEDARO_SMTP_USERNAME', 'SMTP_Injection' );
define( 'CEDARO_SMTP_PASSWORD', '{password}' );
To configure the default From Name and Email, add this snippet in the action callback:
$phpmailer->setFrom(
apply_filters( 'wp_mail_from', 'from@example.com' ),
apply_filters( 'wp_mail_from_name', 'Acme Company' )
);