Node.js example
You can use this Node.js code and enter your own details to run the smtp relay.
Install nodemailer in your Node project
Run this command in your working directory
Include the library in your working class
Declare your SMTP credentials
You should specify your Brevo credentials in order to establish a connection between our server and your application. You will need to make use of the createTransport obeject to define these values.
Compose your email object
Next, specify the content and metadata of the email message you want to send through the previously declared transporter object. In this example we have only included text content, but you can also make use of a predefined templateId .
Trigger your email
Next, specify the content and metadata of the email message you want to send through the previously declared transporter object. In this example we have only included text content, but you can also make use of a predefined templateId. Here you can also see the full example we just went through.
Note: This example is if you want to add more customisations into your SMTP email, it will take the attributes if the contact exists within Brevo. You can this JS code in a file through the command line interface or through the API endpoint for Send a Transactional Email.