EmailReader template - give your database an email address

This little template allows you to read email from your POP3 or IMAP email account, parse those emails and store them in the database along with images, attachments etc. This template can be a part of your CRM, Helpdesk or web-based email client project. You can get this template for $50.

Buy now Live demo

If you are already own EmailReader template v1 or v2 you can upgrade to version 3 for $25.

Note: EmailReader template requires version 10.8 or better of PHPRunner or ASPRunner.NET.

Screenshots and live demos

List of imported email messages
Auto-responder settings

Changes history

Version 3.1 - November 2020

  • Added an option to download recent emails only (by number of days)
  • Added an option to download INBOX only or download from all folders (PHPRunner only)

Version 3 - April 2020

  • Added Auto-responders
  • Added custom functions to process incoming emails

Live demo

To see how it works send a test email to and see it appear in the database. New emails are checked every five minutes. Make sure you are not sending anything confidential there.

Enter live demo

System requirements

  • EmailReader template requires version 10.8 or better of PHPRunner or ASPRunner.NET.
  • PHP version of EmailReader template requires PHP 5.4 or better
  • Supported databases are MySQL, SQL Server, MS Access, Postgre and Oracle

Setup instructions

1. Enable imap extension in php.ini. If you are on a shared web hosting check with your hosting company support if this extension is enabled already.

2. Proceed to mail_settings table and modify path to store attachments. This can be either relative or absolute path. Make sure web server user has write permissions on that folder.

3. Proceed to email_servers table and add one or more pop3/imap servers. Interval between email checks is set in minutes.

4. Schedule a cron job to run getmail.php ( getmail for ASPRunner.NET i.e. https://website/project/getmail ) page every five or so minutes. If your website runs on Linux web server and you have access to crontab file you have two options here.

Method 1: Execute the script using php from the crontab

To execute cron.php every 5 minutes do the following:

Method 2: Run the php script using URL from the crontab

The URL to schedule is https://website/project/getmail.php. The following script executes the php script every 5 minutes by calling the URL using WGET. The -q option indicates quite mode. The "-O temp.txt" indicates that the output will be sent to the temporary file.

If you are not sure how to schedule a cron job open a free account with monitoring service like Montastic and add http://website/project/getmail.php URL to be pinged once a day or or once an hour.

Frequently asked questions

Can I use EmailReader template with ASPRunner.NET?

While EmailReader template is only available for PHPRunner you can use a hybrid approach. PHP part will be reading emails from POP3/IMAP accounts and ASP.NET project will deal with the emails that are already in the database.

1. In PHPRunner create a new project using EmailReader template. Upload it to your website and configure mail settings. If everything setup properly new emails will be stored in mail_messages table.

2. Create a new project in ASPRunner.NET pointing it to the same database. Add mail_settings table to your project. This is it, you can see your emails in mail_messages table.

3. One more step if you need to display inline email images. Set 'View as' type of Body field to 'Custom' and use the following code there:


Can I change the default number of email messages EmailReader retrieves?

You can proceed to business\EmailReader\source folder in project directory and modify getmail.php file. Here is the line that defines the maximum number of messages to retrieve:

How do I verify EmailReader template setup?

In order to test EmailReader template setup send a test email to one of incoming email addresses, wait for cron job to work (or open getmail.php manually in your browser), then see a new email message appear at the top of list.

For instance:

How can I execute some code when a new email arrives?

Proceed to Editor->Custom files and modify emailreader_custom.php file. You can use this function to send a custom autoreposnder or to parse email and store data in the database.