Send email from docker Nextcloud

I didn’t find good instruction to setup Nextcloud in docker with ability to send emails.
I use this docker-compose.yml as base

One the solution is to use bytemark/smtp docker image.

I configured nextloud to send email

When sending email I have such logs from bytemark/smtp

Yes, my port 25 is closed.

  1. Would it be save to open this port to the internet?
    If I open it, who will be able send email?
    As I understand there are no restriction, so everybody can use my server to send emails, this is bad.
  2. Is the any other solution?

Thank you.

I am facing a very similar issue, I can’t send email using nextcloud with docker (official image). Do you have any update on that topic ?