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.
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.
Version 3.1 - November 2020
Version 3 - April 2020
To see how it works send a test email to [email protected] 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 demo1. 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.
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.
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:
C#
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:
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:
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.