How to SendGrid send email with node from terminal

In this post, I am gonna share code snippets which will trigger email along with file content to the given email address usign SendGrid and it will run on top of node js.

Create a folder called emailTrigger and issue npm init --yes, it will create a file called packagejson file. Now install @sendgrid/mail library with npm install @sendgrid/mail.


Now create a file emailTrigger.js along with below code.

In order to trigger email along with the given file content issue following command from your terminal

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.