SHARE
TWEET

Reaproveitando código para não repetir em todos métodos

a guest May 22nd, 2017 505 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function enviar_notificacao(){
  2.    
  3.     $mailconf = $this->setup_mail();
  4.  
  5.     $mailconf->isHTML(true);
  6.     $mailconf->Subject = 'Here is the subject';
  7.     $mailconf->Body    = 'This is the HTML message body <b>in bold!</b>';
  8. }
  9.  
  10. private function setup_mail(){
  11.  
  12.     $mail = new PHPMailer;
  13.     $mail->isSMTP();                                      
  14.     $mail->Host = 'smtp1.example.com;smtp2.example.com';  
  15.     $mail->SMTPAuth = true;                              
  16.     $mail->Username = 'user@example.com';                
  17.     $mail->Password = 'secret';                          
  18.     $mail->SMTPSecure = 'tls';                            
  19.     $mail->Port = 587;  
  20.  
  21.     return $mail;
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top