Send mails

Send mails

by Nuno Miguel Oliveira -
Number of replies: 5

Good afternoon,

My site moodle stopped sending as notifications of publication in nosuns by email.

I use the latest version.

Best regards,

Average of ratings: -
In reply to Nuno Miguel Oliveira

Re: Send mails

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Not sure what a nosun is??  Maybe a forum?  Anyway, has Moodle stopped sending all emails or just from a single activity?

Average of ratings: Useful (1)
In reply to Emma Richardson

Re: Send mails

by Nuno Miguel Oliveira -

Good Morning,

Moodle stopped sending mail from all forums and activities.

Thank you very much.

In reply to Nuno Miguel Oliveira

Re: Send mails

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I would check your outgoing mail settings.  There is a also a plugin for checking your mail set up here: https://moodle.org/plugins/local_mailtest

 

Average of ratings: Useful (2)
In reply to Emma Richardson

Re: Send mails

by Nuno Miguel Oliveira -

Error 1




2017-06-19 21:41:29 Connection: opening to ssl://mail.academy-edu.net:25, timeout=300, options=array ( ) 2017-06-19 21:41:29 Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol [/home/academye/lms.academy-edu.net/lib/phpmailer/class.smtp.php line 294] 2017-06-19 21:41:29 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [/home/academye/lms.academy-edu.net/lib/phpmailer/class.smtp.php line 294] 2017-06-19 21:41:29 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://mail.academy-edu.net:25 (Unknown error) [/home/academye/lms.academy-edu.net/lib/phpmailer/class.smtp.php line 294] 2017-06-19 21:41:29 SMTP ERROR: Failed to connect to server: (0) 2017-06-19 21:41:29 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

In reply to Nuno Miguel Oliveira

Re: Send mails

by Jamie Kramer -

Is this issue still occurring for you?

What version of Moodle are you using?

Go check your smtp/email server settings, typically found at Site Admin > Plugins > Message Outputs > Email

Can you share what the smtp server host setting is? You don't need to share the exact setting if you don't want to give away private details of your setup, but I would like to understand how it is configured. Specifically, does it look something like one of these? (where I've replaced the domain part with an example domain): 

  • mail.example.com:25
  • mail.example.com:587
  • mail.example.com
  • ssl://mail.example.com

Also, can you share what the rest of the settings are on that page? (For username and password, no need to share publicly what those settings are, but for the smtp username and password I am more curious if they are actually set.)

Depending on Moodle version, there may also be a setting for SSL or TLS security. What is that set to?

Is your Moodle server the same server that you are currently using to send mail?

Here are some thoughts on what  could be causing your issue:

  • the email server you are using has been configured to only allow specific types of connections
    • for example, the debug output you posted indicates that it is trying to do a secure SSL connection on port 25. Perhaps the mail server now only allows this type of connection on port 587. If that were the case, you would change your smtp hosts to something like this: mail.example.com:587   (I am using example.com just for demonstration, but the port part with the colon and 587 :587 is the part I am drawing attention to
  • if you are using an smtp username and password.... 
    • then perhaps that smtp username and password are no longer valid
    • or maybe your account with this email service is expired
  • if someone has recently re-configured the smtp server settings in your Moodle
    • then there may be a mistake in the settings


I would advise to get in touch with the person or company that manages the email server that you are connecting to, the server listed in the smtp hosts setting of your email settings. They can provide documentation on correct settings to use to connect to their mail services. This often includes the correct combination of these settings:

  • smtp server
  • smtp port
  • TLS or SSL
  • and maybe username/password to use

Your mail server operator, in some cases, may be able to check mail server logs. However,the email debug you provided is pretty clear, that Moodle can't negotiate a secure connection with your currently configured mail server. The fix could potentially be as easy as adding :587  (which means port 587) to your currently configured smtp host in Moodle mail settings.


My advice is to make documentation of your smtp mail server settings as they are now, in Moodle, before changing anything. This way you can always change them back to what they were during this troubleshooting process.


To recap:

  • find documentation for your email service provider to determine correct settings (perhaps this is linode?)
  • consider trying to add :587 to your currently configured smtp host setting in Moodle, for example:
    • mail.example.com:587
    • (be sure to document your current settings in case you need to change it back)
    • this suggestion to add :587 is only a hunch, but based on my experiences it is worth a try
    • after making a change, perform some action in Moodle that would normally send you an email. Try to capture any debugging information from this action, and/or see if you receive the email after making the change

I hope that helps!


Jamie