Simple, secure mailserver for Nextcloud?

Hello, Nextcloud is yelling at me with the following warning:
You have not set or verified your email server configuration, yet. Please head over to the basic settins in order to set them. Afterwards, use the “Send email” button below the form to verify your settings.

What I already have in my nextcloud configuration:

extraOptions = {
    mail_smtpmode = "sendmail";
    mail_sendmailmode = "pipe";

Does anyone know of a mailserver I could setup for nextcloud in just a few lines that is simple and secure? If you do, I would appreciate a snippet on how I could set it up and connect it to nextcloud. Solutions I found online all seem to be very complicated.

Thank you in advance!

You could try nullmailer with a gmail account:

  services.nullmailer = {
    enable = true;
    remotesFile = pkgs.writeTextFile "remotes" ''
      # smtp --port=465 --auth-login --pass=yourpasswordforlegacyapp --ssl
    config = {
      allmailfrom = "";
      me = config.networking.hostName;

With this sendmail should send emails through your gmail account.

As referenced in the NixOs wiki article on Nextcloud, you could procees with configuring external mail accounts for mail delivery using something like Msmtp Msmtp - NixOS Wiki

In case you want to host your own mail server, which is a different story and still complicated, I’m using Maddy for that Maddy - NixOS Wiki