email server – Send Monit E-Mails via Exim

I installed monit on an Ubuntu 18.04 server and I would like to configure it to send e-mails to my personal e-mail address. I heard that I can send them via the installed exim. However, it does not work. As I am new to both mail servers and monit, I am not sure how to fix it.

In /etc/monit/monitrc, I added

set mailserver 127.0.0.1 port 25

and

set alert user@example.com

where instead of user@example.com I use my personal e-mail address.

To test whether it works, I also pasted

check file alerttest with path /.nonexistent
   alert user@example.com

into the file, again with my personal e-mail address instead of user@example.com.

Despite having checked documentations etc., I am not sure what I am missing here.

The e-mails should be sent directly from the server and not via e.g. Gmail.