Advertisement
Guest User

111

a guest
Apr 4th, 2018
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. define('MAIL_HOST', 'smtp.gmail.com'); define('MAIL_TIMEOUT', 360); define('MAIL_PORT', 465); define('MAIL_USER', 'mysearchuae@gmail.com'); define('MAIL_PASSWORD', 'XXXXXX');
  2. $mail = new PHPMailer(); // create a new object $mail->IsSMTP(); // enable SMTP $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only $mail->SMTPAuth = true; // authentication enabled $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail $mail->Host = "smtp.gmail.com"; $mail->Port = 465; // or 587 $mail->IsHTML(true); $mail->Username = "email@gmail.com"; $mail->Password = "password"; $mail->SetFrom("example@gmail.com"); $mail->Subject = "Test"; $mail->Body = "hello"; $mail->AddAddress("email@gmail.com");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement