I tried a search through the forums but didn't come up with anything, however, I'm not exactly sure how to describe this problem in a few keywords, either. So if any of you know of better keywords, or know this has been discussed/solved before, just let me know.
Here's the situation:
When I use mail() [and yes, I saw all about SwiftMail, and at this time, I'm not interested.
This only started happening which I changed the return address from just the address "nerdywordclub@nerdywordclub.com" to "'The Nerdy Word Club' <nerdywordclub@nerdywordclub.com>"
Here's the code:
Code: Select all
<?php
require "includes/functions.inc";
$webmaster = '"The Nerdy Word Club" <nerdywordclub@nerdywordclub.com>';
$message = "Good Morning. This is the daily mailing of the Nerdy Word Club.\n\n";
$message = $message . "And now for the word:\n\n";
$message = $message . "--------------------------------------------------\n\n";
$query = "SELECT date, username, word, function, definition, name_id FROM words NATURAL JOIN names WHERE date = \"$date\" ORDER BY date ASC";
$result = mysql_query ($query, $connection);
while ($row = mysql_fetch_row($result)) {
$date = "$row[0]";
ereg($date_pattern, $date, $date_parts);
$date = mktime(0, 0, 0, $date_parts[2], $date_parts[3], $date_parts[1]);
$result2 = mysql_query ("SELECT COUNT(word) FROM words WHERE date <= \"$row[0]\" AND name_id = \"$row[5]\"", $connection);
$row2 = mysql_fetch_row($result2);
$count = $row2[0];
$message = $message . date('d F Y', $date) . " ($row[1] -- $count words)\n";
$message = $message . "$row[2] [$row[3]]\n";
$message = $message . "$row[4]\n\n";
}
$message = $message . "--------------------------------------------------\n\n";
$message = $message . "Would you like to receive these mailings on a weekly or monthly basis instead? Or would you like to stop receiving these mailings all together? Or maybe you've got a word you're itching to submit? Login to do all these things.\n\n";
$message = $message . "http://nerdywordclub.com/login.php\n";
$message2 = "Password: [hidden for your security]\n\n";
$message2 = $message2 . "And don't forget, you can now purchase Nerdy Word Club t-shirts! Show off your nerdy pride: http://nerdywordclub.com/merchandise.php\n\n";
$message2 = $message2 . "See you next time,\n";
$message2 = $message2 . "Jeremy C. Ellis\n";
$message2 = $message2 . "$webmaster\n";
$message2 = $message2 . "http://nerdywordclub.com\n";
$headers = "From: $webmaster\n";
$headers = $headers . "X-Sender: $webmaster\n";
$headers = $headers . "X-Priority: 3\n";
$headers = $headers . "Return-Path: $webmaster\n";
$headers = $headers . "X-Mailer: PHP\r\n";
$result = mysql_query ("SELECT username, email FROM names WHERE subscription = 'D'", $connection);
while ($row = mysql_fetch_row($result)) {
$user = $row[0];
$recipient = $row[1];
mail($recipient, "Daily Word from the Nerdy Word Club", $message . "Username: $user\n" . $message2, $headers, "-f$webmaster");
}
?>Thanks for any help!