Sending Out Mail

Hello, getting the following error in the log when trying to send mail. I’ve tried a number of accounts and I know that the credentials work:

Email Send

“Expected response code "250" but got code "421", with message "421 4.7.0 Try again later, closing connection. (EHLO) r7-20020a056870580700b0013755db6486sm516127oap.20 - gsmtp".”

FYI - Using Google GSuite/Workspace

Thanks

@CTG

The Message Code 421 means:
Your message was temporarily deferred by the recipient server. This is usually a result of too many connections in a short timeframe or too many messages.

1 Like

Thanks for the info! Now will have to see how I can adjust that with Google.

1 Like

Just checked everything with Google and it’s working. I’ve even stood up another small app on the same server and it is able to send to the same server/email/credentials.

Any tips/commands to try?

Hi @CTG

Is this failure getting during initial setup or is it a working instance? In the second case you could do a System Check. Click on the small Info Button at the left bottom and select System Check. Are all parts checked green or is something orange or red?

In the first case, you should check the config fields from Mail Setup. For Google Workspace the following Post may help:

Thanks for the info. Everything checks out on both the system and with Google Workspace.

You could try this hint…

By the way: do you use 2FA on your Google Workspace Account? If the answer is yes, you cannot use your normal password, since Google wait for the 2nd factor (OTA).

Thanks again @checkitsedo! Yeah, I saw that post too and have the same settings. I’m not using 2FA on this account and have tested it on a crm app with the exact setting and credentials - it works there.

This one has me stumped as the IN is working perfectly otherwise.

Regards.

An update.

I ran a tcpdump capturing the traffic from the server using a test php-based crm app configured with the same SMTP details and credentials. I initiated an email from that system and it got delivered. I was able go though the data that was captured to a file from that tcpdump and everything within it made sense in terms of data flow.

I ran though the same exact steps with the Invoice Ninja app and it captured nothing.
Are there any commands to test IN mail within it’s folder in the command line?

Thanks

Hi

You could try with:
php artisan ninja:send-test-emails

Which Google SMTP Server do you try to use? smtp.gmail.com or another one?

Regards

1 Like

@david do you have any suggestions?

I would suggest changing the .env variable

QUEUE_CONNECTION=sync

then update the configuration with

php artisan optimize

or run

/update?secret=secret

Then retest mailing.

1 Like

Thanks @david

Changing the queue connection setting worked!

Does this mean that I have a database issue or that there is a bug?

Regards

@CTG

It means on your system, the queues were not running so these tasks were just stacking up inside the queue without running.