[ACCEPTED]-Problem with SMTP authentication in PHP using PHPMailer, with Pear Mail works-phpmailer

Accepted answer
Score: 47

strange issue that i solved by comment this 1 line


whit the last phpmailer version (5.2)

Score: 18

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:

SMTP -> ERROR: AUTH not accepted from server: 250 orion.bommtempo.net.br Hello admin-teste.bommtempo.com.br []
503 AUTH command used when not advertised

While your successful PEAR 4 log shows this:

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.

Score: 3

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";


$mail->Host = 'smtp.mydomainiuse.com'

and it worked :)

Score: 2

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.

Score: 0

that the OpenSSL extension enabled and the 2 directory languages with "br"? first checks 1 the data.

Score: 0

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.

Score: 0

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