1. <?php
  2. require("class.phpmailer.php");
  3. class mail extends PHPMailer {
  4.  
  5. public $login, $password, $server, $from, $from_mail, $title, $template;
  6.  
  7. public function __construct($login, $password, $server, $from, $from_mail, $title, $template)
  8.  
  9. {
  10.  
  11. $this -> GetServerSetting($login, $password, $server, $from, $from_mail, $title, $template);
  12.  
  13. }
  14.  
  15. public function GetServerSetting($login, $password, $server, $from, $from_mail, $title, $template)
  16. {
  17. $this -> Username = $login;
  18. $this -> Password = $password;
  19. $this -> Host = $server;
  20. $this -> FromName = $from;
  21. $this -> From = $from_mail;
  22. $this -> Subject = $title;
  23. $this -> Body = $template;
  24. }
  25.  
  26. function send_invite($to) {
  27. $this -> Mailer = "smtp";
  28. $this -> SMTPAuth = true;
  29. $this -> IsHTML(true);
  30. $this -> AddAddress($to, $to);
  31. $this -> Send();
  32.  
  33. }
  34.  
  35. }
  36. ?>


Mam mniej więcej coś takiego... ale nie mogę wrzucić templatka w smarty sad.gif


  1. <?php
  2. $mail = new mail('mail@wp.pl', 'haslo', 'mail.costam.pl', 'tralala', 'mail@wp.pl', 'Witaj testowy', $smarty->fetch('mails/invite.tpl'));
  3. ?>



Mógłby ktoś pomóc ?