Guest User

Untitled

a guest
Sep 18th, 2018
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. include_once("phpmailer/PHPMailerAutoload.php");
  2.  
  3. $account="xxxxxxx@xxxxxxxx.com";
  4. $password="xxxx";
  5.  
  6. if (!isset($mail)) {
  7. $mail = new PHPMailer();
  8. $mail->SMTPDebug = 2;
  9. $mail->IsSMTP();
  10. $mail->CharSet = "UTF-8";
  11. $mail->Host = "smtp.office365.com";
  12. $mail->SMTPAuth= true;
  13. $mail->Port = 587;
  14. $mail->From = $account;
  15. $mail->Username= $account;
  16. $mail->Password= $password;
  17. $mail->SMTPSecure = 'tls';
  18. $mail->SMTPOptions = array(
  19. 'ssl' => array(
  20. 'verify_peer' => false,
  21. 'verify_peer_name' => false,
  22. 'allow_self_signed' => true
  23. )
  24. );
  25. }
  26.  
  27. $mail->ClearAllRecipients();
  28. $to = 'xxxxxxxxx@gmail.com';
  29. $nombre = 'to';
  30. $mail->addAddress($to, $nombre);
  31. $mail->FromName = "ENTERPRISE";
  32. $mail->isHTML(true);
  33. $mail->Subject = 'SUBJECT: TEST';
  34. $cuerpo = 'TEST';
  35. $mail->MsgHTML($body);
  36. $mail->Body = $body;
  37. $mail->AltBody = 'TEST';
  38.  
  39. if(!$mail->send()) {
  40. echo 'Mailer Error: ' . $mail->ErrorInfo;
  41. } else {
  42. echo true;
  43. }
Add Comment
Please, Sign In to add comment