22 lines
618 B
PHP
22 lines
618 B
PHP
<?php
|
|
// Send outgoing mails through Mailhog
|
|
|
|
function action_wp_mail_failed($wp_error) {
|
|
print_r($wp_error, true);
|
|
exit;
|
|
}
|
|
add_action('wp_mail_failed', 'action_wp_mail_failed', 10, 1);
|
|
|
|
add_action('phpmailer_init', function ($phpmailer) {
|
|
$phpmailer->isSMTP();
|
|
$phpmailer->SMTPAuth = false;
|
|
$phpmailer->SMTPSecure = false;
|
|
$phpmailer->SMTPAutoTLS = false;
|
|
$phpmailer->Host = "mailhog";
|
|
$phpmailer->Port = 1025;
|
|
$phpmailer->From = "noreply@radhr.localhost";
|
|
$phpmailer->FromName = "noreply@radhr.localhost";
|
|
$phpmailer->Username = null;
|
|
$phpmailer->Password = null;
|
|
});
|