# Email server utilizzando IONOS email utilizza account IONOS é impostato sulla porta 3400 installa con ```sh npm init -y npm install body-parser dotenv express nodemailer ``` ## Server semplice inserisci indirizzo soggetto e testo avvia con node s1.js puoi testarlo con ```sh curl -X POST http://192.168.1.3:3400/send-email \ -H "Content-Type: application/json" \ -d '{ "to": "fabio.micheluz@gmail.com", "subject": "Test dal server Express", "text": "Questa è una email di prova inviata via curl" }' ``` ## Server completo inserisci indirizzo soggetto testo html e allegati tutti i parametri di configurazione sono nel file .env avvialo con node s2.js esempio html con un pulsante che rimanda ad un link ```sh curl -X POST http://192.168.1.3:3400/send-email \ -H "Content-Type: application/json" \ -d '{ "to": "fabio.micheluz@gmail.com", "subject": "Email con testo, HTML e allegato", "text": "Questa è la versione testuale della mail.", "html": "

Ciao Fabio!

Questa è la versione HTML.

Esegui chiamata

", "attachments": [ { "filename": "prova.txt", "path": "./prova.txt" } ] }' ``` come é fatto ```sh ├── body-parser@2.2.0 ├── dotenv@17.2.3 ├── express@5.1.0 └── nodemailer@7.0.10 ```