Advertisement
Guest User

PhpMailer

a guest
Mar 7th, 2016
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.26 KB | None | 0 0
  1. // in PhpMailer Mail.php:
  2. class Mail extends PhpMailer
  3. {
  4.     // Set default variables for all new objects
  5.     public $From     = 'booking@tranehuset.no';
  6.     public $FromName = 'SK Trane Booking';
  7.     public $Host     = 'send.one.com';
  8.     public $Mailer   = 'smtp';
  9.     public $SMTPAuth = true;
  10.     public $Username = 'booking@tranehuset.no';
  11.     public $Password = '65a78c397a792a28d418a';
  12.     public $SMTPSecure = 'tls';
  13.     public $WordWrap = 75;
  14.     // [...]
  15.  
  16. // in Controller:
  17.     $mail = new \Helpers\PhpMailer\Mail();
  18.     $mail->IsSMTP();
  19.     $mail->CharSet = 'UTF-8';
  20.     $mail->Host       = "send.one.com"; // SMTP server example
  21.     $mail->SMTPDebug  = 1;                     // enables SMTP debug information (for testing)
  22.     $mail->SMTPAuth   = true;                  // enable SMTP authentication
  23.     $mail->Port       = 465;                    // set the SMTP port for the GMAIL server
  24.     $mail->Username   = "booking@tranehuset.no"; // SMTP account username example
  25.     $mail->Password   = "65a78c397a792a28d418a";        // SMTP account password example
  26.     $mail->addAddress($eventCEmail);
  27.     $mail->subject('Reservasjon av Tranehuset '.$eventDateStartB);
  28.     $mail->body("<h1>Hey</h1><p>I like this <b>Bold</b> Text!</p>");
  29.     $mail->send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement