OKé.
Volgens mij draait m'n script nu wel ongeveer.
Maar nu heb ik een probleem.
Als ik de e-mail verzend, krijg ik op m'n GMAIL account het volgende:
Content-type: text/html; charset=iso-8859-1
From: WPHarmonie <
[email protected]>
Date: Thu, 08 Dec 2005 19:20:12 +0100
Message-Id: <
[email protected]>
<html>
<head>
<title>E-mail</title>
<style>body,html { font-family: 'Arial, Sans-serif'; }</style> </head><body> Dit is een test van het automatisch op de hoogte houd systeem enzo. Grt. Jorik.
</body>
</html>
Op hotmail account, en nog wat anderen werkt het gewoon..
Code:
<?
ERROR_REPORTING(E_ALL);
if($_GET['code'] == "******") {
include("files/connect.php");
$sql = "SELECT * FROM agenda WHERE datum > DATE_SUB(NOW(),INTERVAL 3 DAY) AND mailsent = 0 ORDER BY datum ASC";
$query = mysql_query($sql) OR die(mysql_error());
while($rij = mysql_fetch_object($query)) {
$id = htmlspecialchars($rij->id);
$datum = htmlspecialchars($rij->datum);
$dag = htmlspecialchars($rij->dag);
$vantijd = htmlspecialchars($rij->vantijd);
$tottijd = htmlspecialchars($rij->tottijd);
$wat = htmlspecialchars($rij->wat);
$prioriteit = htmlspecialchars($rij->prioriteit);
$info = htmlspecialchars($rij->info);
$leden_info = htmlspecialchars($rij->leden_info);
$mailsent = htmlspecialchars($rij->mailsent);
$bericht = "<html>\n";
$bericht .= "<head>\n<title>E-mail</title>\n<style>body,html { font-family: 'Arial, Sans-serif'; }</style>\n</head>";
$bericht .= "<body>\n";
$bericht .= "Dit is een test van het automatisch op de hoogte houd systeem enzo. Grt. Jorik.";
#$bericht .= nl2br($_POST['bericht']);
$bericht .= "\n</body>\n</html>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "BCC:
[email protected],
[email protected],
[email protected]\r\n";
$sql = "SELECT email,mailagenda FROM leden WHERE mailagenda = 1 ORDER BY email ASC";
$query = mysql_query($sql);
$tellen = mysql_num_rows($query);
while($rij = mysql_fetch_object($query)) {
#$email = htmlspecialchars($rij->email);
#$headers .= "Bcc: ".$email."\r\n";
}
$headers .= "From: WPHarmonie <
[email protected]>";
$mail = mail("
[email protected]","WPHarmonie: Agendawaarschuwing",$bericht,$headers);
if($mail == TRUE) {
echo "Mail verzonden!";
}else{
echo "error!";
}
}
}else{
echo "Dit script wordt automatisch gestart met een code. Er is geen code ingevoerd of de ingevoerde code is onjuist.";
}
?>