How to make SMTP email with office 365 work with reply to user?

How to make SMTP email with office 365 work with reply to user?

by Miki Alliel -
Number of replies: 2
Picture of Translators

Hello everyone,

We manage to make smtp email to work with office 365 - the settings here

It works but when we set the "forum_replytouser" parameter it dosn't work the emails won't be send we get this error:

SMTP; Client does not have permissions to send as this sender 2017-SMTP ERROR: DATA END command failed: 
SMTP Error: data not accepted. Error: lib/moodlelib.php email_to_user(): SMTP Error: data not accepted.SMTP server error: DATA END command failed

How can we make it work by letting students reply to their teachers. from their own email account?

it is very important to have this function and it's not working.

We even  unchecked the "forum_replytouser" and put manually in "message\output\email\message_output_email.php file "  line 85~

We tried all of this (but nothing works):

$replyto =$eventdata->userfrom->email;

or

$replyto =$eventdata->userfrom;

or

$replyto = $eventdata->replyto;

or

$replyto= $eventdata->replyto->email;

then sending the message - students get the email but when they click 'reply' (in his own gmail account) they can't see the teacher's address but only the support email address of the site.  sad

very frustrating

Any help please (even by changing the code)?

Thanks.

Average of ratings: -
In reply to Miki Alliel

Re: How to make SMTP email with office 365 work with reply to user?

by Miki Alliel -
Picture of Translators

Please does anyone know a solution for this issue?
It could be very useful for everyone