Skip to content

Instantly share code, notes, and snippets.

@ligne13
Created November 18, 2019 16:45
Show Gist options
  • Save ligne13/a9ccca67f48ee9eaffec6a522890fde2 to your computer and use it in GitHub Desktop.
Save ligne13/a9ccca67f48ee9eaffec6a522890fde2 to your computer and use it in GitHub Desktop.
add_action( 'phpmailer_init', function ( $phpmailer ) {
$phpmailer->isSMTP();
$phpmailer->Host = 'smtp.exemple.com';
$phpmailer->SMTPAuth = true; // Indispensable pour forcer l'authentification
$phpmailer->Port = 465;
$phpmailer->Username = 'utilisateur';
$phpmailer->Password = 'motdepasse';
// Configurations complémentaires
//$phpmailer->SMTPSecure = "ssl"; // Sécurisation du serveur SMTP : ssl ou tls
//$phpmailer->From = "[email protected]"; // Adresse email d'envoi des mails
//$phpmailer->FromName = "Nom Exemple"; // Nom affiché lors de l'envoi du mail
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment