1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| public static function send(string $msg, string $subject): void
{
$mail = new PHPMailer();
$mail->isHTML(true);
$mail->CharSet = "UTF-8";
//$mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output
$mail->isSMTP(); //Send using SMTP à enlever si en ligne
$mail->Host = 'smtp.gmail.com'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = 'une_adresse@gmail.com'; //SMTP username
$mail->Password = 'xxxxx'; //SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable implicit TLS encryption
$mail->Port = 465;
///debug
$mail->SMTPDebug = 2; // 0 = off, 1 = commandes, 2 = détails connexion
$mail->Debugoutput = 'html';
etc |
Partager