For development I recommend that you have your Moodle pointed at a mail catching service on your system (for example mailcatcher on Linux) so that you can see that Moodle sends something and don't need to wait on it getting to your mail account and through any spam filtering.
To get things to show up in the message menu you will want to use the Message API: https://docs.moodle.org/dev/Message_API i.e. message_send() rather than email_to_user()
To get things to show up in the message menu you will want to use the Message API: https://docs.moodle.org/dev/Message_API i.e. message_send() rather than email_to_user()