Og så filen mailer.php
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>Udsend mails</title>
<meta name="Generator" content="Stone's WebWriter 4">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="main">
<h1>Udsend mails</h1>
Mailen sendes som Plain Text og BCC (Blind Carbon Copy).<br><br>
<form method="post" action="mailer.php">
<input type="hidden" name="send" value="1">
Navn: <input type="text" name="name" style="width: 120px">
Email: <input type="text" name="email" style="width: 120px"><br>
Emne: <input type="text" name="emne" style="width: 287px"><br>
<textarea name="message" rows="7" cols="0" style="width: 328px"></textarea><br>
<input type="submit" value="Udfør">
</form>
<?php
if (isset($_POST['send'])) {
echo '<hr>';
$emailadresses = implode(',',file('mails.txt'));
$emailadresses = str_replace("\n","",$emailadresses);
mail('',$_POST['subject'],$_POST['message'],"BCC: $emailadresses\nFrom: $_POST[name] <$_POST[email]>");
echo 'Mailen er blevet sendt!';
}
?>
<hr>
<a href="tilm-nyh.php">Tilmeld/afmeld</a> | <a href="mails.txt">mails.txt</a>
</div>
</body>
</html>