Guest User

Untitled

a guest
Nov 20th, 2017
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. function sendMail($mail, $maildata) {
  2. try {
  3. $mail->SMTPDebug = 2;
  4. $mail->isSMTP();
  5. $mail->Host = 'smtp.office365.com';
  6. $mail->SMTPAuth = true;
  7. $mail->Username = 'x@x.co.uk';
  8. $mail->Password = "x";
  9. $mail->SMTPSecure = 'tls';
  10. $mail->Port = 587;
  11.  
  12. $mail->setFrom('x@x.com');
  13. $mail->addAddress($maildata['email']);
  14.  
  15. ob_start();
  16. include('email_template.php');
  17. $message = ob_get_contents();
  18. ob_end_clean();
  19.  
  20. $mail->isHTML(true);
  21. $mail->Subject = 'x';
  22. $mail->Body = $message;
  23. $mail->send();
  24. return 1;
  25. } catch (Exception $e) {
  26. return 0;
  27. }
  28. }
Add Comment
Please, Sign In to add comment