Mailgun SMTP error

I have correctly added the mailgun settings to the file. It gives this error when sending an invitation:

Error sending email! Error sending email: Failed to send email. Reason: 140360242898816:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332: . Please check your email settings and resend the invitation.