Mautic is a powerful email automation tool and you can easily send millions of emails using the versatile email campaign builder that Mautic provides. Even though it is fairly easy to configure and setup email after the first installation, you might face these issues while sending emails through Mautic campaigns. This tutorial covers some of these listed issues that might be the cause of Mautics email issues.
- Mautic mainly runs on Cron jobs, if for some reason they aren't set properly, you might face some issues with Mautic. Mautic allows you to send email through two modes.
- Sending emails immediately
- Sending emails from the queue
- If you have chosen to send emails through the queue, then it will require a Cron job to run in order to send emails. You can set the following Cron to send emails in the email queue.
* * * * * php /path-to-mautic/app/console mautic:emails:send
- You should first run php /path-to-mautic/app/console mautic:emails:send in the terminal first, just to check if the path is proper and to check the resultant output of the command too.
- If you already have the Cron jobs set previously, please check if the Crons are updated as specified by the latest Mautic documentation.
- To know more about Mautic Cron you can follow this guide.
- Mautic provides easy integration of the SMTP services with the server. But without proper configuration, you will not be able to send emails through the SMTP server. Setting up SMTP integration is fairly easy on the Mautic, it has some of the prominent service providers listed in the SMTP providers list, you can choose your provider and just have to set the username and password for it.
- If you don't have a provider listed in the dropdown you have to set a few more credentials by selecting the other options. Please refer to this guide for more information about setting up an SMTP provider with Mautic.
- As for the API settings, you need to check the API key.
- For some email service providers, it is a must that you provide a valid from-address with a registered and verified domain name, else the email won't be forwarded.
Monitored Inbox Settings
- It might happen that you are using IMAP to segment bounced emails from your email inbox by setting the Monitored Inbox Settings and this might cause the emails to stop due to the fact that your email server is rejecting the emails due to the modified from address.
- In order to track bounced emails, Mautic modifies the email from-address in the following format email@example.com, this is sometimes not supported by some of the service providers. For that, you can empty all the fields in the Monitored Inbox Settings and save, this will resolve the issue in this case. If you have webhooks setup form your service provider you can use that to detect the bounced emails.
- Some of the cloud servers might block some of the ports that are used to connect the SMTP servers by default. Most of the servers come with port 25 blocked by default.
- To work around this problem you can use a different SMTP port such as 587 in order to send the emails. In some cases, you might find that port 587 is blocked too. In this case, you can request your server's service provider to unblock the port through their respective communication channel.
- To check the connectivity to the SMTP port you can use the following command.
$ telnet <smtp-provider-host> <Port-Number>
- If you get a 220 response, the SMTP connection is working.
The server has reached the max memory limit
- The situation may arise in case of really large campaigns, you might be able to send test emails but fail to send most of the emails through campaigns.
- Sending emails through a pool of a large email list will exhaust the memory resources.
- One way you can work around it is by extending the memory limit to the PHP service. You can do this by changing the memory limit in the php.ini file.
$ vim /etc/php.ini
- Set the value memory_limit to a higher value. E.g memory_limit = 1024M
Note:- Increasing the memory allocated to PHP will use more RAM and should be set depending on the available resource.
- Another way is to limit the batch of email processed at a time by setting the batch-limit flag in the campaign trigger Cron
* * * * * php /var/www/html/app/console mautic:campaigns:trigger --batch-limit=10
- The batch-limit value could be set higher or lower depending on the memory available in your system. You might have to lower the value to get it working.
With this, we have concluded with some of the most basic problems users can face via sending emails through Mautic. If you want to debug these errors you can check out the following log file to check for possible issues with the Mautic setup.
tail -f app/logs/mautic_prod_[date].php
By following the above-mentioned points, we hope that you are able to find a solution to Mautic's send email problems. The listed points are the most prominent email sending errors people might face. But If you are still facing problems, you might want to check out the Mautic community forums for your solution.