Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/09/2014, 23:27
Avatar de arcanisgk122
arcanisgk122
 
Fecha de Ingreso: junio-2010
Mensajes: 755
Antigüedad: 13 años, 11 meses
Puntos: 28
Pregunta agregar clase phpmailer

hola amigos estoy tratando de agregar una clase tipo php mailer y no logro hacerla funcionar:

Código PHP:
Ver original
  1. <?php
  2. class MailManager{
  3.     private $email;
  4.     function __construct(){
  5.         $this   ->  email   =   new PHPMailer();
  6.     }
  7.     function regmail($username,$email,$nombre,$telf,$country,$date){
  8.         $mail   =   $this ->    email       ->  IsSMTP();
  9.         $subject    = _SUBJECT;
  10.         $mail   =   $this ->    From        = 'email';
  11.         $mail   =   $this ->    Username    = 'email';
  12.         $mail   =   $this ->    FromName    = 'nombre';
  13.         $mail   =   $this ->    Password    = 'password';
  14.         $mail   =   $this ->    Host        = _HOST;
  15.         $mail   =   $this ->    SMTPAuth    = _SMTPAUTH;
  16.         $mail   =   $this ->    SMTPSecure  = _SMTPSECURE;
  17.         $mail   =   $this ->    SMTPDebug   = _SMTPDEBUG;
  18.         $mail   =   $this ->    Port        = _PORT;
  19.         $mail   =   $this ->    Subject     = "
  20.                                 $subject Cuenta Creada para: $nombre";
  21.         $mail   =   $this ->    AltBody     = "
  22.                                 Para ver Este mensaje Active la opcion HTML!";
  23.         $body   =   "<br><br>
  24.                     Hola, se a creado una cuenta en WebPOS Panama para su acceso.<br>
  25.                     <br>
  26.                     Informacion:
  27.                     Username: $username<br>
  28.                     Nombre de usuario: $nombre<br>
  29.                     E-Mail: $email<br>
  30.                     Telefono: $telf<br>
  31.                     Fecha de Registro: $date<br><br>
  32.                     Contraseña: 123456<br><br>
  33.                     <h2>Recuerde Cambiar la contraseña.</h2>
  34.         ";
  35.         $mail   =   $this   ->  email   ->  MsgHTML($body);
  36.        
  37.         if(!$mail-> $this ->    email   ->   Send()) {
  38.             echo "Mailer Error: " . $mail->ErrorInfo;
  39.         }else{
  40.             echo "Message sent!";  
  41.         }
  42.     }
  43. }
  44. ?>

me sale error undefined mail... y otros mas
__________________
Cooler Master Gladiator 600 - AMD PHENOM II X4 955 @ 3.5GHZ
GA-MA78GM-US2H - Super Talent 800 2GB x 2 Dual, (Unganged)
PSU Cooler Master eXtreme Power Plus 500W - Saphire R7-260OC-2GB