Home     Tour     Features     Order     Support     Contact  

PHP Script

[Professional and Corporate Editions Only]
You can use PHP Script to generate all or parts of your message. To engage the script, use the Script macro. Below you can find more details:

Language name: PHPScript

Distributor: The PHP Group

Web site: http://www.php.net/


Download Windows binaries PHP zip package and Collection of PECL modules for PHP.

Create a folder C:\PHP5 and unzip the PHP zip package into that folder

Extract the php5activescript.dll from the Collection of PECL modules for PHP and put it into the C:\PHP5 folder.

Enter Windows command prompt.

Inside the command prompt, change to the PHP folder:

cd C:\PHP5

Register the Active Script DLL with the following command:

regsvr32 php5activescript.dll

The system should show the dialog confirming that the DLL is registered successfully.

Known issues:

PHP script engine does not report run-time errors. Therefore, if errors occur, the messages may not appear as intended, but you will not see an error message. Do preview before sending.

In some situations, non-ascii characters (such as Japanese or Russians) may be treated incorrectly. If you use such characters, test carefully.

PHP script engine leaks memory. Memory leak occurs when you close a Preview window and when sending stops. If you're repeating these actions many times in a row we suggest closing and re-opening AY Mail from time to time to alleviate memory losses.

If you want variables to persist while the script switches from one recipient to other they must be declared as global.

Sample script: This script assumes that the recipient list has data fields Hours and Supervisor and composes a short text based on the values found in these fields.

$hours = $recipient->Hours;
if ($hours->unknown) {

$worked = 0;

} else {

$worked = $hours->value;


$left = 10 - $worked;
if ($left <= 0) {


} else {

$document->write(" reports that you ");
if ($worked == 0) {

$document->write(" have not worked on your assignment. ");

} else {

$document->write("only worked for ");
if ($worked == 1) {

$document->write(" one hour. ");

} else {

$document->write("$worked hours. ");


$document->write("You need ");
if ($left == 1) {

$document->write(" one more hour. ");

} else {

$document->write("$left more hours. ");



 Home     Tour     Features     Order     Support     Contact  

Copyright © 1995-2014 Northern Software Inc. All Rights Reserved