Tema: phpmailer()
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/09/2011, 16:22
Nelita_bg
 
Fecha de Ingreso: junio-2008
Mensajes: 9
Antigüedad: 15 años, 10 meses
Puntos: 0
phpmailer()

Hola foreros,

Copie un código para crear un formulario de contacto con phpmailer() pero tengo éste mensaje de error que no he podido solucionarlo, por favor podrían ayudarme, no tengo experiencia con php.
De antemano muchas gracias

SMTP -> FROM SERVER: 220 vux.bos.netsolhost.com ESMTP Sendmail 8.14.4/8.14.4; Thu, 8 Sep 2011 18:09:07 -0400 SMTP -> FROM SERVER: 250-vux.bos.netsolhost.com Hello 941570.968269@localhost [127.0.0.1], pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-EXPN 250-VERB 250-8BITMIME 250-SIZE 250-DSN 250-ETRN 250-DELIVERBY 250 HELP SMTP -> ERROR: AUTH not accepted from server: 500 5.5.1 Command unrecognized: "AUTH LOGIN" SMTP -> FROM SERVER: 250 2.0.0 Reset state Message Sent OK

Éste es el código:

<?
require_once("class.phpmailer.php");
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

$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 = "localhost"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "localhost"; // sets the SMTP server
$mail->Port = 25; // set the SMTP port for the GMAIL server
$mail->Username = "[email protected]"; // SMTP account username
$mail->Password = "xxxx"; // SMTP account password
$mail->AddReplyTo('[email protected]', 'First Last');
$mail->AddAddress('[email protected]', 'John Doe');
$mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
$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<P></P>\n";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}