0
<?php
if (isset($_POST['send'])) {
$sqls = mysql_query("SELECT * FROM settings LIMIT 1");
$rows = mysql_fetch_array($sqls);

$from    = $rows['email'];
$owner   = $rows['owner'];
$subject = $_POST['subject'];
$message = $_POST['message'];

$sqlu = mysql_query("SELECT * FROM useri WHERE banned='No'");
while ($rowu = mysql_fetch_assoc($sqlu)) {
    $to      = $rowu['email'];
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
    $headers .= 'To: ' . $to . ' <' . $to . '>' . "\r\n";
    $headers .= 'From: ' . $owner . ' <' . $from . '>' . "\r\n";
    @mail($to, $subject, $message, $headers);
}


echo '<meta http-equiv="refresh" content="0;url=newsletter.php">';
}
?>

I don't know where the error is, but i not receive any email... What's wrong ? I searched on stackoverflow before, but i couldn't find the asnwer... Thank You !

GasKa
  • 54
  • 6
  • 1
    is the mail client turned on on your server? – Mr. Concolato Jan 05 '15 at 17:57
  • add `if(mail(...))` without the `@` and echo the $to, $headers before sending mail...to debug – Riad Jan 05 '15 at 17:57
  • No Mr.Concolato . I removed @ and still no error, but i don't understand how to echo $header and stuff. It's first time when i try to do something like this, please patience.. :) – GasKa Jan 05 '15 at 18:11

0 Answers0