Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sendMail2($sujet,$email,$msg)
- {
- $mail = new PHPMailer();
- $mail->IsSMTP(); // send via SMTP
- $mail->Host = "ssl://smtp.gmail.com";
- $mail->SMTPAuth = true; // turn on SMTP authentication
- $mail->Username = "ocean.esprit.tunisie@gmail.com"; // SMTP username
- $mail->Password = "a123456789+"; // SMTP password
- $webmaster_email = "ocean.esprit.tunisie@gmail.com"; //Reply to this email ID
- // Recipients email ID
- // Recipient's name
- $mail->From = $webmaster_email;
- $mail->Port = 465;
- $mail->FromName = "ocean team esprit";
- $mail->AddAddress($email);
- $mail->AddReplyTo($webmaster_email,"ocean team esprit");
- $mail->WordWrap = 50; // set word wrap
- $mail->IsHTML(true); // send as HTML
- $mail->Subject = $sujet;
- $mail->Body = $msg; //HTML Body
- $mail->AltBody = $msg; //Text Body
- if(!$mail->Send())
- {
- echo "Mailer Error: " . $mail->ErrorInfo;
- }
- else
- {
- //$_SESSION['flash']['success']='mail sent';
- header('location: login.php');
- //echo "Message has been sent";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement