Foros del Web » Programando para Internet » PHP »

SwiftMailer...

Estas en el tema de SwiftMailer... en el foro de PHP en Foros del Web. Hola, Tengo un problema… Cambie de un servidor para otro y la librería SwiftMailer me dejo de funcionar. Ahora tengo un Pack Web Pro+ de ...
  #1 (permalink)  
Antiguo 26/01/2007, 13:05
 
Fecha de Ingreso: enero-2007
Mensajes: 3
Antigüedad: 17 años, 3 meses
Puntos: 0
Exclamación SwiftMailer...

Hola,
Tengo un problema…

Cambie de un servidor para otro y la librería SwiftMailer me dejo de funcionar.
Ahora tengo un Pack Web Pro+ de Amen.es…

Estoy intentando de todo, pero no envía mail.

He preguntado a la asistencia de Amen.es se era permitido enviar mail con una conexión via SMTP (puerto: 25) y me han dicho que si. Pero nada… No envía mails.

Sin autentificación:
<<<SCRIPT>>>
<?php

require_once './Swift/Swift.php';
require_once './Swift/Connection/SMTP.php';

//Limits the maximum execution time
set_time_limit(120);

//$swift = new Swift(new Swift_Connection_SMTP('smtp.jazztel.es'));
$swift = new Swift(new Swift_Connection_SMTP('80.168.45.11'));

/*========== PLAIN PART ==========*/
$plain_part = "Testing...";
$swift->addPart($plain_part);
/*================================*/

/*========== HTML PART ==========*/
$html_part = '<b>Testing...</b>';
$swift->addPart($html_part, 'text/html');
/*===============================*/

/*========== RECIPIENTS ==========*/
$recipients = array(
array('Mi Nombre', '[email protected]')
);
/*================================*/

/*========== SUBJECT ==========*/
$subject = 'Newsletter...';
/*================================*/

/*========== SEND MAIL ==========*/
if ($swift->isConnected())
{
$swift->send($recipients, '"Server" <[email protected]>', $subject);
$swift->close();
}
/*===============================*/

/*========== ERRORS ==========*/
if ($swift->hasFailed())
{
$send_mail = 'false';
}else{
$send_mail = 'true';
}
/*============================*/

echo "STATUS: $send_mail<br><br><br>";

echo "LOG: <pre>" . print_r($swift->transactions, 1) . "</pre>";

?>


<<<LOGS>>>
STATUS: true

LOG:

Array
(
[0] => Array
(
[command] =>
[time] => 0.74774100 1169834308
[response] => 220 cgi06-ch.uk.clara.net ESMTP Exim 4.52(Clarahost) Fri, 26 Jan 2007 17:58:28 +0000
)

[1] => Array
(
[command] => EHLO site
[time] => 0.75098200 1169834308
[response] => 250-cgi06-ch.uk.clara.net Hello cgi06-ch.uk.clara.net [195.8.66.22]
250-SIZE 52428800
250-PIPELINING
250-AUTH EXTERNAL
250 HELP
)

[2] => Array
(
[command] => MAIL FROM:
[time] => 0.76235600 1169834308
[response] => 250 OK
)

[3] => Array
(
[command] => RCPT TO:
[time] => 0.76418600 1169834308
[response] => 550 Site not permitted to send mail
)

[4] => Array
(
[command] => RSET
[time] => 0.76682200 1169834308
[response] => 250 Reset OK
)

[5] => Array
(
[command] => QUIT
[time] => 0.76865200 1169834308
[response] => 221 cgi06-ch.uk.clara.net closing connection
)
)


Para enviar mail, por un cliente de mail, necesito autentificación e posiblemente esta aquí el error.
Pero con la librería SwiftMailer nunca tengo una autentificación valida do servidor.

Con autentificación:
<<<SCRIPT>>>
<?php

require_once './Swift/Swift.php';
require_once './Swift/Connection/SMTP.php';

//Limits the maximum execution time
set_time_limit(120);

//$swift = new Swift(new Swift_Connection_SMTP('smtp.jazztel.es'));
$swift = new Swift(new Swift_Connection_SMTP('80.168.45.11'));

if($swift->authenticate('[email protected]', 'password'))
{
echo "AUTH OK<br><br><br>";
}else{
echo "AUTH NOK<br><br><br>";
}

/*========== PLAIN PART ==========*/
$plain_part = "Testing...";
$swift->addPart($plain_part);
/*================================*/

/*========== HTML PART ==========*/
$html_part = '<b>Testing...</b>';
$swift->addPart($html_part, 'text/html');
/*===============================*/

/*========== RECIPIENTS ==========*/
$recipients = array(
array('Mi Nombre', '[email protected]')
);
/*================================*/

/*========== SUBJECT ==========*/
$subject = 'Newsletter...';
/*================================*/

/*========== SEND MAIL ==========*/
if ($swift->isConnected())
{
$swift->send($recipients, '"Server" <[email protected]>', $subject);
$swift->close();
}
/*===============================*/

/*========== ERRORS ==========*/
if ($swift->hasFailed())
{
$send_mail = 'false';
}else{
$send_mail = 'true';
}
/*============================*/

echo "STATUS: $send_mail<br><br><br>";

echo "LOG: <pre>" . print_r($swift->transactions, 1) . "</pre>";

?>


<<<LOGS>>>
AUTH NOK

STATUS: false

LOG:

Array
(
[0] => Array
(
[command] =>
[time] => 0.48769400 1169837705
[response] => 220 cgi01-ch.uk.clara.net ESMTP Exim 4.52(Clarahost) Fri, 26 Jan 2007 18:55:05 +0000
)

[1] => Array
(
[command] => EHLO site

[time] => 0.51899000 1169837705
[response] => 250-cgi01-ch.uk.clara.net Hello cgi01-ch.uk.clara.net [195.8.66.9]
250-SIZE 52428800
250-PIPELINING
250-AUTH EXTERNAL
250 HELP
)

)

)


Si… Se corta el proceso de envió…

Necesito la librería SwiftMailer para enviar newsletters y mails con dudas y preguntas desde mi site.

Necesito ayuda, estoy desesperado :oP

Gracias, Pardalito.
  #2 (permalink)  
Antiguo 27/01/2007, 17:15
Avatar de carlosmbrizuela  
Fecha de Ingreso: enero-2007
Ubicación: La Plata (Argentina)
Mensajes: 490
Antigüedad: 17 años, 3 meses
Puntos: 1
Re: SwiftMailer...

puede ser que al mudarte de servidor no te agarre los include o rquire_once? fijate bien las rutas de acceso. la libreria la deberias instalar vos o sea tenerla en lugar de donde las levantas.
  #3 (permalink)  
Antiguo 29/01/2007, 03:15
 
Fecha de Ingreso: enero-2007
Mensajes: 3
Antigüedad: 17 años, 3 meses
Puntos: 0
Re: SwiftMailer...

Hola

Si… Agarra bien los include_once y los require_once.
Al no agarrar bien no cargaba el script (quedaba en blanco) y no salía la variable $swift->transactions.

Si… La tengo yo instalada y con la misma estructura de carpetas.

Continúo intentando pero… no envía mail y no autentifica.

Estoy sin ideas y pagina sin mail…

¿Alguna ayuda?

Gracias por por la respuesta.
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 17:12.