Advertisement
Guest User

Untitled

a guest
Oct 10th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. public function try_to_send_notification() {
  2. $mail = new PHPMailer();
  3.  
  4. $mail->IsSMTP();
  5. $mail->Host = "your.host.com";
  6. $mail->Port = 25;
  7. $mail->SMTPAuth = false;
  8. $mail->Username = "your_username";
  9. $mail->Password = "your_password";
  10.  
  11. $mail->FromName = "Photo Gallery";
  12. $mail->From = "";
  13. $mail->AddAddress("", "Photo Gallery Admin");
  14. $mail->Subject = "New Photo Gallery Comment";
  15. $created = datetime_to_text($this->created);
  16. $mail->Body =<<<EMAILBODY
  17.  
  18. A new comment has been received in the Photo Gallery.
  19.  
  20. At {$created}, {$this->author} wrote:
  21.  
  22. {$this->body}
  23.  
  24. EMAILBODY;
  25.  
  26. $result = $mail->Send();
  27. return $result;
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement