Advertisement
Guest User

Untitled

a guest
May 9th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. $from = array(
  2. 'name' => 'From Name',
  3. 'email' => 'from@gmail.com',
  4. 'password' => 'password'
  5. );
  6.  
  7. $to = array(
  8. 'name' => 'To name',
  9. 'email' => 'to@email.com'
  10. );
  11.  
  12. $mail = new PHPMailer;
  13.  
  14. $mail->isHTML(true);
  15.  
  16. $mail->isSMTP();
  17.  
  18. $mail->SMTPDebug = 0;
  19.  
  20. $mail->Host = 'tls://smtp.gmail.com:587';
  21.  
  22. $mail->SMTPAuth = true;
  23.  
  24. $mail->Username = $from['email'];
  25.  
  26. $mail->Password = $from['password'];
  27.  
  28. $mail->setFrom($from['email'], $from['name']);
  29.  
  30. $mail->addReplyTo($from['email'], $from['name']);
  31.  
  32. $mail->addAddress($to['email'], $to['name']);
  33.  
  34. $mail->Subject = $subject;
  35.  
  36. $mail->Body = $message;
  37.  
  38. $mail->send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement