Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-8476

Administration/Server/Email setting "Allow users to select character set" causes send() to die

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.7.1
    • Fix Version/s: 1.7.2, 1.8
    • Component/s: Libraries
    • Labels:
      None
    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE

      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.

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            trobb Thomas Robb
            Tester:
            Nobody Nobody
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              30/Mar/07