Code:
//Index.php
<html><head><title>Mailing List Administration</title></head><body>
<br>
<center><H1>Mailing List Administration</H1></center>
Send an email to a mailing list:
<form method=post action="sendemail.php3">
<table><tr><td>
<b>From Address:</b>
<input type=text name="From" size="40" value="">
<br>
<b>Subject:</b><input type=text name="Subject" size="40">
</td><td><table cellspacing=15><tr><td valign=top>
<b>List:</b>
</td><td>
<select name="List" size=4>
<?
$groups = file("lists.txt");
for ($index=0; $index < count($groups); $index++)
{
$grouplist = split("\|", chop($groups[$index]));
?>
<option value="<? echo $grouplist[1] ?>"
<? if ($index==0)
{echo "selected";} ?>
<? echo $grouplist[0] ?><br>
<?
}
?>
</select></td>
<td valign=top><b><a href="newlist.php3">Make a new list.</a></b>
<br><a href="addnames.php3">Add names to a list</a>.
<br><a href="picklist.php3">Edit/Delete names</a>.
<br><a href="data.txt">View Send Log</a>.
<br><a href="autoresponder.php3">View/Edit Autoresponder</a>.
</td></tr></table>
</td></tr></table>
Type or paste your message below:
<br><textarea cols=50 rows=10 name="Body"></textarea>
<br><br>
<input type="submit" name="Submit" value="Send Mail">
</form>
<br>
</body></html>
//send email.php
<html><head><title>Updating file....</title></head><body>
<?
$addresses = file("lists/$List");
for ($index=0; $index < count($addresses); $index++)
{
mail("$addresses[$index]","$Subject",
"$Body","From: $From\nReply-To: $From");
}
$myfile = fopen("data.txt","a");
fputs($myfile,$Subject."\t".date("dS of F Y h:i:s A")."\t".$List."\n");
fclose($myfile);
?>
Your message was sent!
<br><br>
<a href="index.php3">Home</a>.
</body></html>
Here's printscreen of the error msg.
Comment