Bonjour, s'ils vous plaît j'ai besoin de votre aide. Pour mettre à jour mon code d'envoi de mail PHPMAILER.
Si vous avez une pour problème je suis à votre écoute. MERCI
<?php
date_default_timezone_set('Etc/UTC');
// Edit this path if PHPMailer is in a different location.
require './PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->isSMTP();
/*
* Server Configuration
*/
$mail->Host = 'smtp.gmail.com'; // Which SMTP server to use.
$mail->Port = 587; // Which port to use, 587 is the default port for TLS security.
$mail->SMTPSecure = 'tls'; // Which security method to use. TLS is most secure.
$mail->SMTPAuth = true; // Whether you need to login. This is almost always required.
$mail->Username = "monadress@gmail.com"; // Your Gmail address.
$mail->Password = "1234567890"; // Your Gmail login password or App Specific Password.
/*
* Message Configuration
*/
$mail->setFrom('from@example.com', 'Domaine'); // Set the sender of the message.
$mail->addAddress($email, 'Md Oury'); // Set the recipient of the message.
$mail->Subject = 'PHPMailer GMail SMTP test'; // The subject of the message.
/*
* Message Content - Choose simple text or HTML email
*/
$body = "<div align='center' style='background:#464b91;color:#fff;padding:20px; width:400px; margin:10px auto;'>
<b style='text-align:center;font-size:19px; font-weight:400;'>Bonjour ".$f_name."</b><br/>
<span style='font-size:15px; color:#fff;'>Votre code d'activation est pret cliquer sur le boutton activé pour vous connecté</span><br/><br/>
<a style='font-size:19px; background:#942604; padding:5px 20px; color:#fff; text-decoration:none;margin:10px auto;' href='http://localhost/projet/login.php?name=".urlencode($f_name)."&key=".$key." '>Activé</a>
</div>";
// Choose to send either a simple text email...
$mail->isHTML(true);
$mail->Body = $body; // Set a plain text body.
// ... or send an email with HTML.
//$mail->msgHTML(file_get_contents('contents.html'));
// Optional when using HTML: Set an alternative plain text message for email clients who prefer that.
//$mail->AltBody = 'This is a plain-text message body';
// Optional: attach a file
$mail->addAttachment('images/phpmailer_mini.png');
if ($mail->send()) {
echo "Your message was sent successfully!";
} else {
echo "Mailer Error: " . $mail->ErrorInfo;
}
?>
</div>
<div class="title">
</div>