How to Get Notified if Email Alerts Failed to Send

November 16, 2023

This is a guide that will help you setup an external notifier if your Jotform email alerts failed to send or were in the bounce list. 

Please note that this is for advanced users or who are familiar with programming. 

Here are the requirements and steps needed to be followed:

  1. You need to have a server that runs PHP where you can execute the PHP script. Please consult your web hosting service for this.
  2. We will need to use PHPMailer to send the notifier using your email’s SMTP. Here’s the official Github page of PHPMailer: https://github.com/PHPMailer/PHPMailer. You’ll need to consult your email service provider to get your SMTP details. If you have a Gmail account, you can follow this guide and use that instead: Gmail’s SMTP Settings
  3. Our script will use both the PHPMailer and Jotform’s API. What happens is that our script will check the mail log to your account and compare the submission ID of the form submitted to see if the email alerts were successfully sent. You can check Jotform’s PHP API library here: Jotform API PHP Library 
  4. You can then copy the PHP script I made on this link: Email Status Checker PHP Script. This is what triggers the external email notifier to send. 
  5. In the PHP script, you need to setup a few things, first, you need to use your API key here:
How to Get Notified if Email Alerts Failed to Send Image-1
  1. After that, make sure to fill out the necessary SMTP details in the PHP script. You need to fill out the host, port, your username, password, recipient address, etc…
How to Get Notified if Email Alerts Failed to Send Image-2
  1. You can then edit the text that will be displayed after the script is executed. Or you can also redirect the user to another link. The body of the email can be edited here:
How to Get Notified if Email Alerts Failed to Send Image-3
  1. Now make sure to enable the “Send POST Data” in your Preferences setting. 

Click “Form Settings” tab and click “Show More Options”.

How to Get Notified if Email Alerts Failed to Send Image-4

Here you need to enable the “Send Post Data” option to “Yes”.

How to Get Notified if Email Alerts Failed to Send Image-5
  1. Now placed the link of your PHP script to your “Thank You” settings:
How to Get Notified if Email Alerts Failed to Send Image-6

Paste the path of your PHP script here.

How to Get Notified if Email Alerts Failed to Send Image-7
  1. Here’s an example of how this works:

A user submits your form.

How to Get Notified if Email Alerts Failed to Send Image-8

The user will then be redirected to the PHP script and it will execute it. The script will check if there are failed email alerts on that specific submission. In my case, I’m printing the details of the email alert that failed. You can, of course, change this message or redirect the user to another link. Below you can see that my autoresponder failed because the email address I entered is test@test.com which is not valid.

How to Get Notified if Email Alerts Failed to Send Image-9

If there was indeed an email alert that failed, then it will notify the recipient email address you setup in the SMTP in our PHP script. In my case, this is how it looks like:

How to Get Notified if Email Alerts Failed to Send Image-10

You can edit the body of the email. 

You now have a script that notifies you if any of your email alerts fails. In case you find failed email alerts, you can check this section on how to troubleshoot email problems: Guides: Email Problems

If you have any questions, feel free to leave a comment below or you can open a new thread in our forum.

Push Notifications for Jotform Apps
Academy Logo

Introduction to Form Building

Adding Conditional Logic Elements

Go to course :Adding Conditional Logic Elements
lesson-2 - image
Contact Support:

Our customer support team is available 24/7 and our average response time is between one to two hours.
Our team can be contacted via:

Support Forum: https://www.jotform.com/answers/

Contact Jotform Support: https://www.jotform.com/contact/

Send Comment:

Jotform Avatar
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Podo Comment Be the first to comment.