You can find here some examples of Node.js code to send data to a Postfix server.
These examples are designed to run with a Stackhero Postfix service. You'll more informations about Stackhero here:
git clone https://github.com/stackhero-io/documentations.git
cd documentations/content/postfix/codeExamples/
First, you have to fill the .env-example file and rename it to .env.
Then you can run the script with npm run start.
This example will send you an email. Check your inbox :)