email_to_user function is not working

email_to_user function is not working

by Manoel Manev -
Number of replies: 0

Hello! 

Currently I have that problem: I am making activity module. After I submit my form and went to the <modulname>_add_instance() function, I wаnt to call email_to_user function to all users that are in the course. But after calling the function nothing is happening.

$subject="test";
$message="testing";
email_to_user($USER, $USER, $subject, $message)

(Тhis is test for calling this function to one user, but still it is not working)
I set up too an SMTP Connection in Moodle, but still i don`t get why this is not working.   

Average of ratings: -