you need to remove the line ini_set, as this will overide the default mail setings for php.
your script will always tell you the mail has been processed as it is not checking only printing.
You also need to have more headers for most SMTP servers to accept to send your mail
change send.php for this and try
PHP Code:
<?php
require ('connect.php');
$badmail = 0;
$goodmail = 0;
//standard mail header
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: you@yourdomain.com\r\n"; // change this address
$headers .= "Reply-To: you@yourdomain.com\r\n"; // and this one
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n";
$headers .= "X-Mailer: PHP \r\n";
//get message
//loop through
for($x=0; $x<count($_GET);$x++)
{
if ($_GET["mail_$x"])
{
//mail setup
$to = $_GET["mail_$x"];
$subject = "Newsletter";
$body = "Dear ".$_GET["name_$x"]."
\n\n $message \n\n
FoodieCorp.
";
if (mail($to, $subject, $body, $headers)){
$goodmail++;
}else{
$badmail ++;
}
}
}
echo "$goodmail emails sent - $badmail emails not sent.";
?>
Bookmarks