problem in sending email

problem in sending email

by m question -
Number of replies: 1

Hi,

I have a problem & I am not sure how to debug it or solve it

we used Gmail to send our emails and now we are changing to paid service

when I change the settings and try to send email from Moodle (I click forget password & I enter username) I don't receive email

but also I don't see this action in Moodle logs!

when I change the settings(change port to other number)

I get the error from logs

Failed to send an email from the user with id '-20' to the user with id '277' due to the following error: "SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting".

=============

SMTP hosts : smtp.mailgun.org:465

SMTP security:TLS

SMTP Auth Type:LOGIN

SMTP username:postmasterXXXXX

SMTP password:XXXXXX

SMTP session limit:1

when I enable debug error

Error code: cannotmailconfirm
Stack trace:
  • line 482 of \lib\setuplib.php: moodle_exception thrown
  • line 150 of \login\lib.php: call to print_error()
  • line 52 of \login\lib.php: call to core_login_process_password_reset()
  • line 78 of \login\forgot_password.php: call to core_login_process_password_reset_request

==

when I change the settings to 

SMTP hosts : ssl://smtp.mailgun.org:465

SMTP security:SSL

SMTP Auth Type:LOGIN

SMTP username:postmasterXXXX

SMTP password:XXXXXXXX

SMTP session limit:1

I don't get any error, even when I enable debug errors

& I don't see this logged in the Moodle log

also, I don't receive email

I appreciate any help


Average of ratings: -
In reply to m question

Re: problem in sending email

by m question -

is the directions suggested here correct??

"2. A manual change is necessary. Login to your moodle database, In "mdl_config" table there is a row whose "name" column contains "supportemail". (In my db this row has id=432, but it might differ on other installations.) The "value" column specifies the email address which is used as From address in outgoing system emails, please configure it to be the same email address as your SMTP username. Apparently, the Moodle UI does not give access to this, so this needs to be changed manually."

link

I changed the support email from Moodle UI & it changed in db, but I am not sure if the new setting is correct & I still can't use Mailgun to send emails 

I hope someone can help me