Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require("class.phpmailer.php"); // path to the PHPMailer class
- $mail = new PHPMailer();
- $mail->IsSMTP(); // telling the class to use SMTP
- $mail->Mailer = "smtp";
- $mail->Host = "smtp.gmail.com";
- $mail->Port = 465;
- $mail->SMTPSecure = 'ssl';
- $mail->SMTPAuth = true; // turn on SMTP authentication
- $mail->Username = "gmail"; // SMTP username
- $mail->Password = "pass"; // SMTP password
- $mail->AddAddress("tareksabry333@outlook.com");
- $mail->From = "gmail";
- $mail->Subject = "PHP Mailer";
- $mail->Body = "Test";
- $mail->WordWrap = 50;
- if(!$mail->Send()) {
- echo 'Message was not sent.';
- echo 'Mailer error: ' . $mail->ErrorInfo;
- } else {
- echo 'Message has been sent.';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement