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

No option in email settings to speccify SSL or TLS (SMTPSecure property of PHPMailer)

    Details

    • Testing Instructions:
      Hide

      1. find a SMTP server that accepts TLS or SSL only
      2. specify the full SMTP hostname:port in Email settings, e.g.:smtp.example.com:587
      3. open up /login/forgot_password.php in browser and trigger a password reset email
      4. the cannotmailconfirm error show up

      Show
      1. find a SMTP server that accepts TLS or SSL only 2. specify the full SMTP hostname:port in Email settings, e.g.:smtp.example.com:587 3. open up /login/forgot_password.php in browser and trigger a password reset email 4. the cannotmailconfirm error show up
    • Workaround:
      Hide

      in moodle 2.2, editing get_mailer() function in /lib/moodlelib.php to add:
      $mailer->SMTPSecure = "tls"; // or "ssl";
      after $mailer->IsSMTP();

      Similar fixes can also be done directly in the /lib/PHPMailer files to force SSL/TLS.

      Show
      in moodle 2.2, editing get_mailer() function in /lib/moodlelib.php to add: $mailer->SMTPSecure = "tls"; // or "ssl"; after $mailer->IsSMTP(); Similar fixes can also be done directly in the /lib/PHPMailer files to force SSL/TLS.
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-30960_master

      Description

      There is no option to specify the SMTPSecure property of PHPMailer in the admin email settings section. Specifying just the :port by itself is insufficient to trigger PHPMailer to use SSL/TLS connection prefix and will not initiate the connection correctly.

      If I remember correctly, this has been an issue since early 1.x (1.6?).

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  2 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    16/Nov/15