0

I have localhost xampp server with Mercury mail server. With Thunderbird email client I can send and recive mails from localhost.

But when try send with CakePHP 3.1.x i got error message:

SMTP server did not accept the password.

i use same login data:

    'EmailTransport' => [
    'default' => [
        'className' => 'Smtp',
        // The following keys are used in SMTP transports
        'host' => 'localhost.dev',
        'port' => 25,
        'timeout' => 30,
        'username' => 'info',
        'password' => 'info',
        'client' => null,
        'tls' => null,
    ],
],

Mercury log when send and recive with Thunderbird

T 20151202 221930 565f69f1 Connection from 127.0.0.1
T 20151202 221930 565f69f1 EHLO [127.0.0.1]
T 20151202 221930 565f69f1 MAIL FROM:<nikola@localhost.dev> SIZE=385
T 20151202 221930 565f69f1 RCPT TO:<info@localhost.dev>
T 20151202 221930 565f69f1 DATA
T 20151202 221930 565f69f1 DATA - 12 lines, 385 bytes.
T 20151202 221930 565f69f1 QUIT
T 20151202 221930 565f69f1 Connection closed with 127.0.0.1, 0 sec. elapsed.

Mercury log when try to send and recive with CAKEPHP

T 20151202 222318 565f69f2 Connection from 127.0.0.1
T 20151202 222318 565f69f2 EHLO localhost
T 20151202 222318 565f69f2 AUTH LOGIN
T 20151202 222318 565f69f2 QUIT
T 20151202 222318 565f69f2 Connection closed with 127.0.0.1, 0 sec. elapsed.
ryanyuyu
  • 6,366
  • 10
  • 48
  • 53
Salines
  • 5,674
  • 3
  • 25
  • 50
  • I'd suggest to start with inspecting the mercury logs, and compare what is being sent from CakePHP and Thunderbird. – ndm Dec 02 '15 at 21:15
  • OK, i add logs, thunderbird and cakephp – Salines Dec 02 '15 at 21:24
  • 4
    Instead of editing the answer into your question, you should instead post the solution as an answer. In the meantime, I've removed the "answer" portion of the question. – ryanyuyu Jan 12 '16 at 15:32
  • You use Chrome and login with your email that use to send mail in CakePHP app, and then you access 2 the link to allow less security app access your gmail. [https://accounts.google.com/b/0/DisplayUnlockCaptcha] [https://www.google.com/settings/security/lesssecureapps] – Quy Le Oct 02 '16 at 16:23

1 Answers1

2

If anyone ever had the same problem, the solution is:

 'password' => null,
YSC
  • 38,212
  • 9
  • 96
  • 149
Salines
  • 5,674
  • 3
  • 25
  • 50
  • To add to this for other people, I had a similar problem using G suite (Google Apps). I was also specifying a password. Also make sure you've configured "SMTP relay service" in your Google admin console. – toast Nov 14 '16 at 07:10