Foros del Web » Programando para Internet » PHP »

phpmailer error de permiso fedora12 i php5.3.1

Estas en el tema de phpmailer error de permiso fedora12 i php5.3.1 en el foro de PHP en Foros del Web. SMTP -> ERROR: Failed to connect to server: Permission denied (13) SMTP Error: Could not connect to SMTP host. <?php include("class.phpmailer.php"); include("class.smtp.php"); $mail = new ...
  #1 (permalink)  
Antiguo 21/12/2009, 05:38
 
Fecha de Ingreso: febrero-2009
Mensajes: 443
Antigüedad: 15 años, 2 meses
Puntos: 1
phpmailer error de permiso fedora12 i php5.3.1

SMTP -> ERROR: Failed to connect to server: Permission denied (13)
SMTP Error: Could not connect to SMTP host.


<?php
include("class.phpmailer.php");
include("class.smtp.php");

$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch

$mail->IsSMTP(); // telling the class to use SMTP

try {
$mail->Host = "mail.yourdomain.com"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "tls"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 587; // set the SMTP port for the GMAIL server
$mail->Username = "[email protected]"; // GMAIL username
$mail->Password = "*********"; // GMAIL password
$mail->AddReplyTo('[email protected]', 'First Last');
$mail->AddAddress('[email protected]', 'John Doe');
$mail->SetFrom('[email protected]', 'First Last');
$mail->AddReplyTo('[email protected]', 'First Last');
$mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
$body = "Hola, este es un…";
$body .= "<font color='red'> mensaje de prueba</font>";

$mail->Body = $body;
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
//$mail->MsgHTML(file_get_contents('contents.html'));
//$mail->AddAttachment('images/phpmailer.gif'); // attachment
//$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
$mail->Send();
echo "Message Sent OK\n";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}

?>
  #2 (permalink)  
Antiguo 21/12/2009, 08:42
 
Fecha de Ingreso: abril-2008
Mensajes: 435
Antigüedad: 16 años
Puntos: 10
Respuesta: phpmailer error de permiso fedora12 i php5.3.1

mas que claro no?

Cita:
SMTP -> ERROR: Failed to connect to server: Permission denied (13)
SMTP Error: Could not connect to SMTP host.
chequea si los datos de acceso a gmail estan bien, puertos smtp etc

saludos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:21.