Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. $mail = new PHPMailer(true);
  2. try
  3. {
  4. //Tell PHPMailer to use SMTP
  5. $mail->isSMTP();
  6. $mail->SMTPDebug = 2;
  7. $mail->Debugoutput = 'html';
  8. $mail->Host = "smtp.gmail.com";
  9. $mail->Port = 587;
  10. $mail->SMTPAuth = true;
  11. $mail->SMTPSecure = "tls";
  12. $mail->Username = "username@gmail.com";
  13. $mail->Password = "pass";
  14. $mail->setFrom('username@gmail.com', 'First Last');
  15. $mail->addAddress("$mailto", 'John Doe');
  16. $mail->Subject = 'PHPMailer SMTP test';
  17. $mail->msgHTML("asdf");
  18. $mail->AltBody = 'This is a plain-text message body';
  19. $mail->AddStringAttachment($qr_base64, "Filename.png");
  20. $mail->send();
  21. } catch (phpmailerException $e) {
  22. echo $e->errorMessage();
  23. } catch (Exception $e) {
  24. echo $e->getMessage();
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement