MassMailer template - send email newsletters and automatic daily/weekly emails

This template is designed to perform two common emails tasks:

  1. Send email newsletters
  2. Send daily, weekly or hourly emails. Perfect for billing reminders or daily reports

You can get this template for $50.

Buy now

If you are already own MassMailer template v1, v2 or v3 you can upgrade to version 4 for $25.

Note: MassMailer template requires a valid license of version 10.8 or better of PHPRunner or ASPRunner.NET or ASPRunnerPro.

Changes history

Version 4.0 - December 2018

  • Template is made compatible with version 10.x of PHPRunner, ASPRunner.NET and ASPRunnerPro.

Version 3.0 - November 2017

  • Bootstrap-based layouts
  • Send email or SMS or both
  • Schedule delivery by day of week
  • Attach project page as HTML or PDF

Version 2.1 - January 2016

  • Add/Edit task pages modification made easy
  • Added reply-to field to emails

Version 2 - May 2015

  • Send email/newsletter with attachments
  • Multiple subscription lists
  • Bulk import subscribers
  • Subscription widget/unsubscribe link
  • Single opt-in or double opt-in
  • Use a free form query or pick one of subscription lists while selecting recipients

Version 1.1 - March 2015

  • Repeating sections in templates
  • Execute SQL after each email

Version 1.0 - February 2015

  • Template based emails
  • Email scheduling
  • Email preview
  • SQL query/template syntax instant manual


Click images for full size screenshots

List of tasks
Single task setup
Email body and attachments
SQL Query results view
SQL Query help
Email preview
Template syntax help

System requirements

Supported databases are Microsoft Access, SQL Server, MySQL, Oracle and Postgre

Setup instructions

1. Make sure you specified the correct SMTP settings in PHPRunner project. SMTP settings can be found under Miscellaneous->Email settings.

2. Create a new task. For one-off tasks like email newsletter choose Interval Type 'manual'. For recurring tasks like daily reports choose Interval Type like 'day'.

3. Enter SQL Query, make sure it returns correct data. Populate email fields like 'To', 'Subject' and 'Email body'. Preview your email. Send test email. If everything looks good save your task.

4. Schedule a cron job to run cron script once a day or once an hour.

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 1 hour, use the following crontab file: Note: when you run a cron job from the command line cron.php won't know your website URL and 'unsubscribe' link in emails will not work. To fix this edit <Project Folder>\business\MassMailer\source\cron.php file. Find the following line there: and replace it with something like this ( is the URL of your project):

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

The URL to schedule is https://website/massmailer/cron.php. The following script executes the PHP script every hour by calling the URL using WGET. The -q option indicates quiet 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 a monitoring service like Montastic and add a cron page URL to be pinged once a day or once an hour.

Cron page URL:
PHPRunner: httsp://website/massmailer/cron.php
ASPRunnerPro: https://website/massmailer/cron.asp
ASPRunner.NET: https://website/massmailer/cron

Frequently asked questions

I've created a task but don't want it to run yet. Can I make it inactive?

Yes, you can choose Interval to be manual and it will not run until you start it manually.

My email addresses are stored in the database field. How do I setup this?

In TO field specify %EmailAddressField%. Instead of EmailAddressField use the actual name of the field that stores email addresses.

How do I use 'Execute SQL query after email sent' field

This field is optional and can be left empty. Use it when you need to update a record in the main table after email is sent. Typical use includes updating Status field with value like 'sent' or update EmailSent field with the current date/time.

Sample query:

Note how we reference the field from the main SQL query via %main.CustomerID%.

How to insert unsubscribe link?

Simply insert %unsubscribe% tag anywhere in email body. Note that this tag only makes sense when email is sent to subscription list.

How do I change FROM email address?

This can be changed right in the software (PHPRunner, ASPRunnerPro, ASPRunner.NET). Proceed to Miscellaneous screen, click 'Email settings' and enter FROM email address there.

How do I setup SMTP server to send my emails?

This can be changed in the software (PHPRunner, ASPRunnerPro, ASPRunner.NET). Proceed to Miscellaneous screen, click 'Email settings' and enter SMTP server details there.

What is subscription widget?

"Subscription widget" or "subscription form" is a piece of HTML code that can be inserted into any page of your website allowing website visitors subscribe to your newsletter. Here is how it typically looks. Subscription widget doesn't come with its own CSS and will inherit look and feel of your website.

Subscription is done via AJAX, page won't be reloaded.

How to format date values in my emails?

By default date values are presented as is in your email meaning you will see something like this: Your invoice is due on 2015-06-17 00:00:00. This is obviously not what you looking for.

You can modify your SQL query to retrieve date values in nicely formatted way i.e. 06/17/2015

And this is how it supposed to look when you run it:

Each database comes with its own functions for date formatting. In MySQL you can use DATE_FORMAT.

How to insert an image into my email?

The best option is to use HTML email and insert an img tag specifying complete URL of image file. Here is an example:

How to execute multiple queries after email was sent?

You can use multiple queries in 'Execute SQL query after email sent'. Use semicolon to separate queries.

Do you have more complex examples of MassMailer template usage?

Glad you asked. See how you can manage password reminders and expiration using MassMailer template.

What SMS providers do you support?

The default SMS provider is Twilio. Other supported providers are:,,,, In your software manual proceed to Miscellaneous settings->Multiple SMS providers section to find out how to switch to another provider.

How to attach a page from the project that is password protected?

You can attach a page from your project to every email you send. You can choose between PDF and HTML attachment formats. PDF format works better with View and Printer-friendly pages


How to attach the page that is password-protected?

1. In MassMailer task enter either a hardcoded username and password (send the same attachment to all users) or select username and passwords fields (every user will receive a copy of their own data).

2. In your project, where the page to be exported resides, add the following code to AfterAppInit event. MassMailer template will pass username/password to the page to be exported and the following code will help to access a password protected page.

PHPRunner: ASPRunner.NET: ASPRunnerPro: