Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/07/2015, 08:42
Avatar de Middrel
Middrel
 
Fecha de Ingreso: abril-2005
Mensajes: 835
Antigüedad: 19 años
Puntos: 27
Respuesta: Duda con PHPMailer

Hola Triby, gracias por responder!

En la mayoría de los casos veo que tengo bien la configuración. Con respecto al puerto, usan el 26, pero aún cambiándolo no consigo enviar el correo.

Mi configuración en este momento esta como:

Código PHP:
                $mail = new PHPMailer();

        
//$body = file_get_contents('contents.html');
        //$body = preg_replace('/[]/','',$body);
        
$body $shtml;
        
$mail->IsSMTP(); // telling the class to use SMTP
        
$mail->Host "smtp.dominio.jobs"// SMTP server
        
$mail->SMTPDebug 2// enables SMTP debug information (for testing)
        // 1 = errors and messages
        // 2 = messages only
        
$mail->SMTPAuth true// enable SMTP authentication
        
$mail->Host "smtp.dominio.jobs"// sets the SMTP server
        
$mail->Port 26// set the SMTP port for the GMAIL server
        
$mail->Username "[email protected]"// SMTP account username
        
$mail->Password "C0nt4ct0$"// SMTP account password

        
$mail->SetFrom('[email protected]''dominio.jobs');
        
$mail->AddReplyTo('[email protected]','dominio.jobs');
        
$mail->Subject $ssubject;
        
//$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
        
$mail->MsgHTML($body);
        
$address $email;
        
$mail->AddAddress($address"Nada");
        
//$mail->AddAttachment("infinite.gif"); // test attachment I added to /mailer
        //$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment

        
if(!$mail->Send()) {
        echo 
"Mailer Error: " $mail->ErrorInfo;
        } else {
        echo 
"Message sent!";
        } 
Ya jugué con el puerto, usando el 25 y 26 pero nada :/