Hallo,
ik heb nog een vraag.
Als ik een email wil verzenden dan geef hij een fout melding hij verzend de email wel maar er staat geen bericht in
Dit is de fout melding
PHP
Notice: Undefined variable: subject in /home/mneyrfca/domains/hotopnia.nl/public_html/news_handler.php on line 31
Notice: Undefined variable: message in /home/mneyrfca/domains/hotopnia.nl/public_html/news_handler.php on line 31
Notice: Undefined variable: subject in /home/mneyrfca/domains/hotopnia.nl/public_html/news_handler.php on line 31
Notice: Undefined variable: message in /home/mneyrfca/domains/hotopnia.nl/public_html/news_handler.php on line 31
Notice: Undefined variable: subject in /home/mneyrfca/domains/hotopnia.nl/public_html/news_handler.php on line 31
Notice: Undefined variable: message in /home/mneyrfca/domains/hotopnia.nl/public_html/news_handler.php on line 31
Notice: Undefined variable: subject in /home/mneyrfca/domains/hotopnia.nl/public_html/news_handler.php on line 31
Notice: Undefined variable: message in /home/mneyrfca/domains/hotopnia.nl/public_html/news_handler.php on line 31
Toon Meer
Dit is het script
PHP
<?
ini_set('display_errors', 1);
error_reporting(E_ALL);
include 'db_settings.php';
include 'messaging.php';
if ($_SERVER['REQUEST_METHOD'])
{
if (!empty ($_POST['subject']))
{
if (!empty ($_POST['message']))
{
mysql_connect($hostname, $user, $password) or die($error3);
mysql_select_db($db) or die($error4);
$sendto = $_POST['sendto'];
if ($sendto == '2')
{
$res = mysql_query("SELECT * FROM newsletter");
while ($obj = mysql_fetch_object($res))
{
$to = $obj->email;
$sender = "[email protected]";
$name = "Beuckelaere Tom";
$headers = "From: 'Beuckelaere Tom' <[email protected]>\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
mail($to, $subject, $message, $headers) or die ($error6);
}
echo $message1;
}
else if ($sendto == '1')
{
$res = mysql_query("SELECT * FROM newsletter WHERE html = 1 ");
while ($obj = mysql_fetch_object($res)) {
$to = "$obj->email";
$sender = "[email protected]";
$name = "Beuckelaere Tom";
$headers = "From: 'Beuckelaere Tom' <[email protected]>\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
mail($to, $subject, $message, $headers) or die ($error6);
}
echo $message1;
}
else
{
$res = mysql_query("SELECT * FROM newsletter WHERE html = 0 ");
while ($obj = mysql_fetch_object($res)) {
$to = "$obj->email";
$sender = "[email protected]";
$name = "Beuckelaere Tom";
$headers = "From: 'Beuckelaere Tom' <[email protected]>\r\n";
mail($to, $subject, $message, $headers) or die ($error6);
}
echo $message1;
}
}
else
{
echo $error2;
}
}
else
{
echo $error1;
}
}
?>
Toon Meer