Postfix configuration for system notifications

I’m a bit confused on how to configure postfix for nextcloudpi.
After installation of an fresh image postfix is running (ncp-web panel).
In Nextcloud settings I’ve setup SMTP Mail delivery for my googlemail. The testmail works fine.

But I still can’t send mails via command line or with my daily backup script.
I use:
Subject: Test

I believe I don’t understand how this is working (the difference between NC and commandline sending mails) and if I still need to setup postfix.

I simply used this guide to enable postfix: Setting Up Gmail (and Other Email) on a Raspberry Pi | by Stacy Prowell | The Startup | Medium

Now everything is working, but I still would like to know why NC mails and system mails are handled differently.

maybe you find your explaination here

I am not sure but I think NC uses phpmailer or something similar.