Buenas,
Sigo liada con lo mismo.
Finalmente he retrocido de versión y sigo con class.phpmailer.php
He avanzado un poco, pero me surge un error, busco la solución pero no la entiendo.
El error es el siguiente:
Código Error:
Ver originalSMTP -> FROM SERVER:220 smtp-03.servidoresdns.net ESMTP Postfix
SMTP -> FROM SERVER: 250-llsa736-a03.servidoresdns.net 250-PIPELINING 250-SIZE 51200000 250-ETRN 250-STARTTLS 250-AUTH PLAIN DIGEST-MD5 CRAM-MD5 LOGIN 250-AUTH=PLAIN DIGEST-MD5 CRAM-MD5 LOGIN 250-ENHANCEDSTATUSCODES 250 8BITMIME
SMTP -> FROM SERVER:250 2.1.0 Ok
SMTP -> FROM SERVER:553 5.7.1 : Sender address rejected: not owned by user
[email protected] SMTP -> ERROR: RCPT not accepted from server: 553 5.7.1 : Sender address rejected: not owned by user
[email protected]
He buscado el error 553 5.7.1 y dice lo siguiente:
Código Descripción:
Ver originalThis is the error message that is received when you are trying to send an email as a different user. This error message is seen by the users who are using Exchange servers with our system.
You need to add an identity for the same in the webmail. For example,
Add the identity from the settings tab for
[email protected] (If the from address is
[email protected]). For more information, please refer: http://support.mailhostbox.com/email-users-guide/sender-identities
Once the identity is added and confirmed, you should be able to send the emails.
Parece com si el username y el from fuesen diferentes, y no lo son. Por lo que no entiendo que sugiera crear una identidad/alias para poder enviar
Y el código PHP:
Código PHP:
Ver originalrequire "class/class.phpmailer.php";
$mailPrto = new PHPMailer(); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch
try {
$mailPrto->IsSMTP();
$mailPrto->SMTPAuth = true;
$mailPrto->SMTPDebug = 2;
$mailPrto->Host = 'smtp.dominio.es';
$mailPrto->Port = 25;
$mailPrto->Password = "contraseña";
$mailPrto->AddReplyTo = $cor_;
$mailPrto->FromName = $nom_;
$mailPrto->AddAddress(Correo, 'Cliente'); //para
$mailPrto->SetFrom($cor_, 'Mensage web'); //de
$mailPrto->CharSet = 'UTF-8';
$mailPrto->Subject = "Sol·licitud";
$mailPrto->AltBody = 'bla bla bla'; // texto alternativo
$mailPrto->IsHTML(true);
$mailPrto->MsgHTML($message);
$mailPrto->Send();
echo '<p>Mensaje enviado correctamente'</p>';
} catch (phpmailerException $e) {
echo $strMsgFrmErr[$idioma].' '.$e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $strMsgFrmErr[$idioma].' '.$e->getMessage(); //Boring error messages from anything else!
}
Alguien puede ayudarme? Gracias