How to prevent Limesurvey email invitations or reminders being treated as spam

Spam really is a problem these days and without spam filters, email would hardly be usable. But this also causes problems when sending email invitations or reminders at Limesurvey. Often users complain about not having received an invitation/reminder email because the user’s spam filter treated the Limesurvey email as spam. At this blog post we will outline the technical details and different approached to solve the problem.

Limesurvey emails and spam filters

If an email is treated as spam mostly depends on the spam filter being used and its settings. You may notice that sending emails to customer A may work fine while Limesurvey emails sent to customer B get marked as spam. So in general, this is not a Limesurvey issue.
A spam filter usually checks the sender address and the email subject and content. That also means that there are different approaches to optimize these details so spam filters do not  treat your Limesurvey invitation and reminder emails as spam. We will show you the different options below.

Tips & Tricks

(The following list will be updated every now and then)

Sender address

  1. Use a valid sender address (can be set at the Limesurvey survey settings -> General -> Admin email).
  2. Do not use a sender address from a one time email provider. These are often used for spam and therefore blacklisted by most spam filters. Email from email providers like Gmail, Hotmail, GMX and the like might also be considered as spam quite often because everybody can get an account there.
  3. If possible use a sender address which has been in use for years and was never related to any spamming, e. g. your company’s email address.
  4. Use the same address as admin and bounce email address. Some spam filters don’t like it if these addresses differ, especially when using SMTP emailing.

Sending Limesurvey emails in batches

If you have to send several hundred or even several thousand emails, this can really be painful. When sending them all at once using a huge email batch size (see details below at “Mailserver”) the script will most probably time out. Furthermore, there is a high risk of being treated as spammer so your IP address or domain could be put on a blacklist. 

The best approach for sending a huge amount of emails is using cronjob scripts. For this we have coded a script to automtically send email invitations. There is also another script for automatically sending email reminders.
You just upload the script to your server and set which survey(s) the script should deal with. Afterwards, you can set up a cronjob to call the script every X minutes. So if you need to send 3000 emails, just set the batch size to 50, call the script every 5 minutes and within 5 hours (50*12*5=3000) everything is done without any further user interaction required. Of course, these scripts only send an invitation once so you do not spam your participants.

Sending emails this way significantly reduces the risk that other tools treat your Limesurvey emails as spam or block them. If your provider enforces a limit of max X emails every Y minutes you can easily work around that by adjusting the settings at the cronjob script.

Email content

  1. The content of your email is probably the most important part. Do never use any words like “free”, “buy”, “sex”, “shop”, “viagra” or the like at your email invitation or email reminder texts. You can change the default texts at the “email templates” link of the survey options menu.
  2. Same for the email subject: Use a meaningful text that doesn’t use the word “invitation” because it can be found at spam emails quite often.
  3. If you send the exact email text several times, this might also look suspicous to spam filters. The solution is to use the {FIRSTNAME}/{LASTNAME} email placeholders at the Limesurvey email templates to create some unique strings.
  4. Often it’s worth a try to switch from HTML emails (Limesurvey default setting) to raw text emails. At Limesurvey this can be changed at Survey settings -> Tokens -> “Use HTML format for token emails” = “no”.
  5. Spammers often use images for fake emails, so better not use any images at your emails.
  6. Of course you want to add a link to the survey at your invitation and reminder emails. But in general links should be reduced to a minimum and opt-out links are often used for fishing, so if you are facing serius spam problems, not adding any links at all might help.
  7. When using HTML emails and editing the email messages, check that the HTML being used has a valid HTML syntax, e. g. all tags should be closed properly. There are several HTML validators available, e. g. the official W3C validator where you can copy paste the HTML code. You can view the HTML source code text by switching the editor to source code mode:
    Source code mode of integrated Limesurvey editor

Mail server configuration for Limesurvey emails

  1. Emails can either be sent by the webserver using PHP emailing which is the Limesurvey default setting or by connecting to an SMTP server. Since PHP emailing is mostly used for spam, we recommend to switch to SMTP if you are facing spam problems. At Limesurvey this can be configured at Global settings -> Email settings -> “Email method” = “SMTP”
  2. Especially when using “PHP” email setting, some webservers will block emails if a certain amount of emails is send in a minute/an hour/a day. So make sure that when manually sending the emails the batch size is not too big. This can either be set when sending email at the token screen or by editing Limesurvey’s default setting (50) at Global settings -> Email settings -> “Email batch size” = “XYZ”.
  3. If possible use a web server which hasn’t been connected to spamming anyway. Spam filters also analyse the IP range a server belongs to and if there have been spam issues with this range before. So using your company’s server or the SMTP server of known providers such as Gmail should help.
  4. A wrong mail server configuration also effects spam filters. There are several different settings that could be wrong. We are using the Mail Tester service to get detailed information about such configuration issues.
    The experts out there can have a look at the email source code to check some of the sender server configuration settings like email header, spam score (if available), …

Additional information and tools:

Cronjob scripts for automatic email sending

Testing for existing Limesurvey spam issues

Additional links