Email Following a Letter Template
A common project activity involves sending email to a group,
following a template.
Common Framework
A typical approach has these steps:
-
Prepare a template file, stored in the current directory
-
Regular text will be sent in the format of the file
-
Special "words" may be used to personalize an email:
For example, to say 'Dear soandso,'
the file template would specify'Dear $name,'.
-
For this example, special "words" are:
-
$date = Today's date (This will change to whatever date
you send the email; if you want a hard-coded date, you must type
it in)
-
$name = person's name from the database
-
$email = person's address from the database
-
For simple scripts, the file template is limited to 8192 characters.
-
Run a script in "testing" mode to check that the email letter looks
appropriate (in "testing" mode, the email is sent to the application
administrator)
-
Run a script in "real" mode to actually send the email
Common Administrator Interface
NOTES:
-
Use of invalid email addresses in testing
generates error messages for the Mail Server Administrator
-
Please be responsible in testing!!!
The following form provides a typical starting page.