How do I troubleshoot email configuration?

I set entered Mailgun smtp details during setup of v5.

The test email sent okay (from what I recall … as I would have looked into it if it hadn’t).

I have set up a test invoice, and sent it. But no email hit the MG server, nor did I receive the email.

How would I go about troubleshooting the issue?

Hi,

You can change the settings by manually editing the .env file

If your config is cached you’ll have to run php artisan optimize after changing the file

The thing is AFAIK the settings are correct.

MAIL_MAILER=log
MAIL_PORT=587
MAIL_ENCRYPTION=tls
MAIL_HOST=smtp.mailgun.org
MAIL_USERNAME=postmaster@mg.***REDACTED***.nz
MAIL_FROM_NAME='***REDACTED***'
MAIL_FROM_ADDRESS=***REDACTED***@gmail.com
MAIL_PASSWORD=***REDACTED***

Is there a way to troubleshoot why messages are not sending?

I’ve looked in the laravel log, and I can see an email is generated to the test client, and another is generated for the admin (a notification to say an email was sent to client). I see PDFs were attached. But there’s no sign of any error data or success / failure data.

On the front-end, Ninja states the email was successfully sent.

Also, if I set up a php script on the site to send emails using those same credentials, it sends fine. So it’s not a connectivity issue between the server and Mailgun.

@hillel Let me know if this is something I should bring up on Github Issues, or whether it’s fine to deal with it here.

for SMTP your MAIL_MAILER should be smtp instead of log

1 Like

Oh brilliant. That was an easy fix.
How on earth was that set to ‘log’ ? Bizarre. Spent hours trying to figure this out!

Thank you.

1 Like

I think if our e-mail checks fail during the setup, it’ll fall back to “log”. It has been fixed in the recent versions.

Glad you solved it! :+1:

1 Like

Where to see whether the e-mail has been sent indeed? .env changed to smtp, php artisan optimize - done, it’s shown “e-mail has been sent successfully” but it’s never been received to the specified e-mail.

You can check on the system logs tab in the client preview

Sorry but where exactly?

When you select a client you’ll see a preview pane on the right side of the page, the last tab is called “System logs”.

I see. Empty - there is nothing

Are the crons running? I suggest checking if there are any rows in the jobs table.

crons are running - at least there is no mistake shown that CRONS NEED TO BE SET UP

@david any ideas to debug this?

so two possibilites here:

  1. The queue is not running (check the database table jobs to see if any records are in there (it should be empty))
  2. There is a configuration error / or a direct error message from the email server (check database table system_logs, the SMTP server error will be reported in there)

I seam to be having the same problem. Emails not being received although it’s saying that “email sent successfully”. Nothing in the jobs table and nothing in system_logs table smtp related.

Same issue here… No logs

Got mine figured out… Hope this helps someone else out:

When doing the initial install I had to select log. When I went back in and changed to smtp, I have a local server that doesnt required authentication. I thought I could leave those fields blank, but it only worked when I put the value of null.

1 Like