Wordpress PHPMailer
Configuration de PHPMailer au sein de Wordpress.
Dans le fichier functions.php, insérer le code suivant en personnalisant les variables de configuration :
function adeo_phpmailer_example( $phpmailer ) {
$host = "ssl0.ovh.net";
$username = "adeo@xpres.fr";
$password = 'GX5r"KvFa';
$replyto = "contact@adeo.asso.fr";
$fromMail = $username;
$fromName = get_bloginfo('name');
$secureProt = 'tls'; //ssl
$port = $secureProt == 'tls' ? 587 : 465;
$smtpAuth = !empty($username.$password);
$phpmailer->isSMTP();
$phpmailer->Host = $host ;
$phpmailer->SMTPAuth = $smtpAuth; // Ask it to use authenticate using the Username and Password properties
$phpmailer->Port = $port;
$phpmailer->Username = $username;
$phpmailer->Password = $password;
// Additional settings…
$phpmailer->SMTPSecure = $secureProt; // Choose 'ssl' for SMTPS on port 465, or 'tls' for SMTP+STARTTLS on port 25 or 587
$phpmailer->From = $fromMail ;
$phpmailer->FromName = $fromName;
}
add_action( 'phpmailer_init', 'adeo_phpmailer_example' );