Guest User

Untitled

a guest
Sep 11th, 2010
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.23 KB | None | 0 0
  1. class Mailer extends PHPMailer
  2. {
  3.     public function __construct($sender = array(), $isHTML = true)
  4.     {
  5.         $this->Mailer = 'smtp';
  6.         if($this->Mailer == 'smtp')
  7.         {
  8.             $this->Host = "smtp.gmail.com";
  9.             $this->Port = 587;
  10.             $this->SMTPSecure = "tls";
  11.                 $this->SMTPAuth = true;
  12.                 $this->Username = "[email protected]";
  13.                 $this->Password = "jelszo";
  14.         }
  15.         if (!is_array($sender) || empty($sender))
  16.         {
  17.             // felado beallitasa vmire ha nincs megadva
  18.         }
  19.         else
  20.         {
  21.             list($key, $val) = $sender;
  22.             $this->Sender = $key;
  23.             $this->From = $key;
  24.             $this->FromName = $val;
  25.         }
  26.         $this->isHTML($isHTML);
  27.     }
  28. }
  29.  
  30.             $mail = new Mailer(array('felado email', 'felado neve'));
  31.             $mail->AddAddress(
  32.                 'cimzett email',
  33.                 'cimzett neve'
  34.             );
  35.             $mail->Subject = 'Targy';
  36.             $mail->Body = 'uzenet, HTML tamogatassal';
  37.             if ($mail->Send())
  38.             {
  39.                 // minden ok
  40.             }
  41.             else
  42.             {
  43.                 // baj van
  44.             }
Advertisement
Add Comment
Please, Sign In to add comment