Autoresponders are mechanisms that automatically email a message to a user when a certain event is completed. Usually, this would be when a new user signs into the list by using a form. To edit the autoresponder, a technique similar to what we used to edit addresses will be used:
<html><head><title>Edit Maillist addresses</title></head><body>
<form method=post action="writeautoresponder.php3">
This is the automatic message sent to people who submit
their name to the Test List mailing list. See Page 5 in the
tutorial to see an example of using this feature.
<textarea cols=70 rows=20 name="Body">
<? readfile("data/autoresponder.txt"); ?>
<input type="submit" name="submit" value="Save This List"></FORM>
<br><br><a href="addnames.php3">Add names to a list</a>.
<br><br><a href="data/log.txt">View Send Log</a>.
And then the form saves our
<b>The following autoresponder message has been saved:</b><br>
$myfile = fopen("data/autoresponder.txt","w");
<pre><? echo $Body ?> </pre><br>
To activate it, create a code snipet which will put a small
form on any page you choose. Something similar to this would work anywhere:
<b>Get notified of updates by email:</b><br>
<form method="post" action="thanks.php3">
<input type="text" name="Email" size="20">
<input type="submit" Value="Subscribe"></form>
All thatís left is a processing and Thank You page, which
borrows code from the other pages made earlier:
Note line 4 Ė itís a lightly documented trick that allows you
to read an entire file into a variable, which is exactly what we need to do here. Of course, if you use this script yourself, it will probably be in another directory, so watch your paths. Also note this is just for one list Ė what would you need to do to make multiple autoresponders?
And thatís it! Now your new members will immediately receive a welcome message, or be sent important info, receive a joke of the day, or whatever else you can dream up!