Envio de correo con Exchange y PHP
Publicado por Mike (17 intervenciones) el 21/04/2011 00:16:01
Hola listeros
Espero y alguien me pueda ayudar. estoy tratando de enviar un correo utilizando servidores Exchange de Microsoft.
el problema que al trata de conectarme, me marca el siguiente error.
SMTP -> FROM SERVER:220 smtp.mail.microsoftonline.com Microsoft ESMTP MAIL Service ready at Wed, 20 Apr 2011 07:46:11 -0700
SMTP -> FROM SERVER: 250-smtp.mail.microsoftonline.com Hello [12.69.122.226] 250-SIZE 31457280 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-AUTH 250-8BITMIME 250-BINARYMIME 250 CHUNKING
SMTP -> ERROR: AUTH not accepted from server: 504 5.7.4 Unrecognized authentication type
SMTP -> FROM SERVER:250 2.0.0 Resetting
SMTP -> FROM SERVER:451 5.7.3 Must issue a STARTTLS command first
SMTP -> ERROR: MAIL not accepted from server: 451 5.7.3 Must issue a STARTTLS command first
SMTP -> FROM SERVER:
SMTP -> ERROR: RSET failed:
Message did not sent
Mailer Error: Language string failed to load: from_failed [email protected]
el codigo que utilizo es el siguiente:
<?php
require("../correo/class.phpmailer.php");
$mail = new PHPMailer();
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail->IsSMTP(); // send via SMTP
$mail->Host = "smtp.mail.microsoftonline.com"; // sets GMAIL as the SMTP server
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->TLS = true;
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Port = 587; // set the SMTP port for the GMAIL server
$mail->Username = "[email protected]"; // SMTP username
$mail->Password = "XXXXXXX"; // SMTP password
$mail->From = "[email protected]";
$mail->FromName = "Usuario";
$mail->AddAddress("[email protected]");
$mail->WordWrap = 100; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Notification ";
$mail->Body = "Usted ha recibido una solicitud <b> <FONT color ='Blue'> $add_numpo </FONT> </b>.
<br><br> You have received a notification <b> <FONT color ='Blue'> $add_numpo </FONT> </b>.
<br><br> Fecha de envio / Sent: $today
Notificacion de prueba.
";
if(!$mail->Send())
{
echo "Message did not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
?>
este codigo me funcionaba muy bien con los anteriores servidores de correos que teniamos....pero ahora que tenemos Exchanges....es un problema, ya que no puedo encontrar la solucion.
Los de Microsoft me dicen que tengo que tener habilitado el TLS...pero esto como lo hago?
Alguien ha utilizado o trata de enviar un correo por medio de servidores Exchange?
si es asi, me podrian pasar o dar referencia de un script o codigo?
saludos
Espero y alguien me pueda ayudar. estoy tratando de enviar un correo utilizando servidores Exchange de Microsoft.
el problema que al trata de conectarme, me marca el siguiente error.
SMTP -> FROM SERVER:220 smtp.mail.microsoftonline.com Microsoft ESMTP MAIL Service ready at Wed, 20 Apr 2011 07:46:11 -0700
SMTP -> FROM SERVER: 250-smtp.mail.microsoftonline.com Hello [12.69.122.226] 250-SIZE 31457280 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-AUTH 250-8BITMIME 250-BINARYMIME 250 CHUNKING
SMTP -> ERROR: AUTH not accepted from server: 504 5.7.4 Unrecognized authentication type
SMTP -> FROM SERVER:250 2.0.0 Resetting
SMTP -> FROM SERVER:451 5.7.3 Must issue a STARTTLS command first
SMTP -> ERROR: MAIL not accepted from server: 451 5.7.3 Must issue a STARTTLS command first
SMTP -> FROM SERVER:
SMTP -> ERROR: RSET failed:
Message did not sent
Mailer Error: Language string failed to load: from_failed [email protected]
el codigo que utilizo es el siguiente:
<?php
require("../correo/class.phpmailer.php");
$mail = new PHPMailer();
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail->IsSMTP(); // send via SMTP
$mail->Host = "smtp.mail.microsoftonline.com"; // sets GMAIL as the SMTP server
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->TLS = true;
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Port = 587; // set the SMTP port for the GMAIL server
$mail->Username = "[email protected]"; // SMTP username
$mail->Password = "XXXXXXX"; // SMTP password
$mail->From = "[email protected]";
$mail->FromName = "Usuario";
$mail->AddAddress("[email protected]");
$mail->WordWrap = 100; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Notification ";
$mail->Body = "Usted ha recibido una solicitud <b> <FONT color ='Blue'> $add_numpo </FONT> </b>.
<br><br> You have received a notification <b> <FONT color ='Blue'> $add_numpo </FONT> </b>.
<br><br> Fecha de envio / Sent: $today
Notificacion de prueba.
";
if(!$mail->Send())
{
echo "Message did not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
?>
este codigo me funcionaba muy bien con los anteriores servidores de correos que teniamos....pero ahora que tenemos Exchanges....es un problema, ya que no puedo encontrar la solucion.
Los de Microsoft me dicen que tengo que tener habilitado el TLS...pero esto como lo hago?
Alguien ha utilizado o trata de enviar un correo por medio de servidores Exchange?
si es asi, me podrian pasar o dar referencia de un script o codigo?
saludos
Valora esta pregunta


0