|
Posted by robbiesmith79 on 07/05/07 14:46
I'm trying to spam myself :-\ with 2,000 emails, shooting for 15,000,
and I will occasionally get two identical emails. I'm putting a
$counter++ as the from and part of the subject line so I can see
what's going on. Any reason why this might happen? here's my code just
in case.
$counter=1;
function send_mail($emailaddress, $fromaddress, $emailsubject, $body,
$method) {
global $counter;
# Common Headers
if ($method == "text") {
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";
} elseif ($method == "html") {
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";
}
$from = $counter++;
$headers .= 'From: Me <'. $from . '@gmail.com>';
$msg = $body;
$msg = wordwrap($msg, 70);
$emailsubject .= " :: " . $from;
# SEND THE EMAIL
mail($emailaddress, $emailsubject, $msg, $headers);
}
$message = "<h2>Hello World</h2>";
$subject = "Test Email";
$to = "myemail@address.com";
$fromaddress = "";
for ($x=0; $x<2000; $x++) {
send_mail($to, $fromaddress, $subject, $message, "html");
}
[Back to original message]
|