Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'phpmailer/PHPMailerAutoload.php';
- $mail = new PHPMailer();
- try {
- $mail = new PHPMailer(); //New instance, with exceptions enabled
- $mail->IsSMTP(); // tell the class to use SMTP
- $mail->SMTPAuth = true; // enable SMTP authentication
- $mail->SMTPSecure = ssl; // enable SMTP authentication
- $mail->Port = 465; // set the SMTP server port
- $mail->Host = "mail.gmail.com"; // SMTP server
- $mail->Username = "elbidanisaid@gmail.com"; // SMTP server username
- $mail->Password = "Soukainazwina91"; // SMTP server password
- $mail->IsSendmail(); // tell the class to use Sendmail
- $mail->AddReplyTo("elbidanisaid@gmail.com","First Last");
- $mail->From = "elbidanisaid@gmail.com";
- $mail->FromName = "First Last";
- $mail->AddAddress("r1_said@hotmail.fr");
- $mail->Subject = "First PHPMailer Message";
- $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
- $mail->WordWrap = 80; // set word wrap
- $mail->MsgHTML("bonjour<br> said");
- $mail->IsHTML(true); // send as HTML
- $mail->Send();
- echo 'Message has been sent.';
- } catch (phpmailerException $e) {
- echo $e->errorMessage();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement