[ACCEPTED]-Problem with SMTP authentication in PHP using PHPMailer, with Pear Mail works-phpmailer
strange issue that i solved by comment this 1 line
//$mail->IsSmtp();
whit the last phpmailer version (5.2)
Try adding this:
$mail->SMTPAuth = true;
$mail->SMTPSecure = "tls";
By looking at your debug 6 logs, you can notice that the failing PhpMailer 5 log shows this:
(..snip..)
SMTP -> ERROR: AUTH not accepted from server: 250 orion.bommtempo.net.br Hello admin-teste.bommtempo.com.br [200.155.129.6]
(..snip..)
503 AUTH command used when not advertised
(..snip..)
While your successful PEAR 4 log shows this:
DEBUG: Send: STARTTLS
DEBUG: Recv: 220 TLS go ahead
My guess is that explicitly 3 asking PHPMailer to use TLS will put it 2 on the right track.
Also, make sure you're 1 using the latest versin of PHPMailer.
This happened to me as well. For me, Postfix 6 was located at the same server as the PHP 5 script, and the error was happening when 4 I would be using SMTP authentication and 3 smtp.domain.com instead of localhost.
So 2 when I commented out these lines:
$mail->SMTPAuth = true;
$mail->SMTPSecure = "tls";
and 1 set the host to
$mail->Host = "localhost";
instead
$mail->Host = 'smtp.mydomainiuse.com'
and it worked :)
Check if you have set restrict outgoing 4 SMTP to only some system users (root, MTA, mailman...). That 3 restriction may prevent the spammers, but 2 will redirect outgoing SMTP connections 1 to the local mail server.
that the OpenSSL extension enabled and the 2 directory languages with "br"? first checks 1 the data.
Exim 4 requires that AUTH command only be 7 sent after the client issued EHLO - attempts 6 to authenticate without EHLO would be rejected. Some 5 mailservers require that EHLO be issued 4 twice. PHPMailer apparently fails to do 3 so. If PHPMailer does not allow you to force 2 EHLO initiation, you really should switch 1 to SwiftMailer 4.
This isn't on the code parter it's on the 4 server side Contact your Server Manager 3 or fix it from server if you own it If you 2 use CPANEL/WHM GO TO WHM/SMTP RESTRICTIONS 1 AND DISABLE IT
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.