Details
Description
For a week I have been having back-and-forths with my ISP support staff about why messages on a new Moodle 1.7,1+ installation was not sending out messages. Cron was working properly and messages in the database were getting tagged with a "1" for "sent" although nothing ever went out and no error messages were generated. It turns out that they were dying when $mail->Send() was invoked in moodlelib.php (around line 3424).
Looking at the $mail object, I discovered that the [Body],[FromName] and [Subject] were blank even though the correct values were there when checked with debugging output higher up in the email_to_user function. It turns out that the section just above if ($mail-.Send()) that starts with the code below was returning NULL for these values.
/// If we are running under Unicode and sitemailcharset or allowusermailcharset are set, convert the email
/// encoding to the specified one
if (!empty($CFG->unicodedb) && (!empty($CFG->sitemailcharset) || !empty($CFG->allowusermailcharset))) {
The site is set to use Unicode.
In 1.8 this line appears to have been changed to:
if ((!empty($CFG->sitemailcharset) || !empty($CFG->allowusermailcharset))) {
Can you confirm that this fixes your problem in 1.7?