- b2evolution CMS User Manual
- Back-office Reference
- Emails
- Troubleshooting
- Emails don't arrive / Email notifications don't work
Emails don't arrive / Email notifications don't work
b2evolution will send emails in a number of occasions:
- a user wants to register
- a user forgot his password and requested a new one
- a user wants to contact the admin
- a user wants to contact another user
If you are not receiving these email notifications you may want to do the following:
Check your Spam folder
First things first: have you checked your spam folder? (especially if you’re using Gmail which is extremely aggressive on qualifying anything with an "unsubscribe" link as spam…)
Check that b2evolution actually sends the emails
In case you doubt that b2evolution actually sends out the emails, you can very easily see ALL the emails that b2evolution has sent.
In the back-office, navigate to Emails > Sent.
This shows ALL the emails that b2evolution has tried to send. It also shows whether or not the system accepted the emails or not.
- If b2evolution doesn’t even try to send the emails, you need to look in b2evolution’s configuration. For example:
- Start by setting notifications to "Send immediately" here: After each new post or comment…
- Make sure your test users accept to receive more than the default of 3 messages per day here: Receiving Notifications Panel
- Once you see the email has actually been sent by b2evolution, you need to look in the server setup what makes the emails not being sent. See below.
Check if your web host is blocking outbound email
b2evolution uses PHP’s mail()
function to send these emails.
Some hosting providers, however, disables this function for security (spam) reasons. Usually, if this is the case, your b2evo will show a warning message alerting you of the situation. Before trying something else, you should double-check that the email output is enabled in your server by using the script below:
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$additional_parameters = '-r webmaster@example.com';
mail($to, $subject, $message, $headers, $additional_parameters);
?>
- Replace "nobody@example.com" in the script with an email address that you have access to.
- Upload the script to your server (via FTP or edited directly in a new file).
- Execute the PHP script on command line or directly at your browser.
- You should receive the email.
If you receive this sample email in your inbox, we can rule out the server configuration as a possible cause and continue with our investigation. Maybe, you should check the email notification settings for each feature.
Check the params being passed to the mail()
function
In b2evolution 6.7.5+, see: PHP mail() Function Settings.
In older b2evolution versions, see the following:
On some web hosts, the defaults params that b2evolution passes to the mail()
function will not be accepted. You can tweak them to some extent with the $sendmail_additional_params
variable you will find in the _advanced.php configuration file. The default setting is $sendmail_additional_params = '-r $return-address$';
.
If sending email results in errors (red dots in the "Sent emails" log), try these variations (in the following order):
$sendmail_additional_params = '-f $return-address$';
$sendmail_additional_params = '-r $return-address$ -f $return-address$';
$sendmail_additional_params = '';
If one of these variants works, please be so kind to leave a comment below with the name of your web host and the variant that works for you. Thank you!
Configuring an SMTP Gateway
If you can’t get PHPs built-in mail()
feature to work as expected (generally due to limitations of your webhost), you will need to configure an SMTP Gateway which can be locally provided by your webhost or be a remote SMTP Server that you are allowed to use (you will typically need a username and password). This could be the server of your normal cloud email account (Gmail, Yahoo!, Fastmail, etc.)
You can set up an SMTP Gateway in the SMTP Gateway.
User Report: ICDsoft hosting requires
-f