Sending Emails with SendGrid
What You'll Need
Backbench account - Sign Up, the personal account will always remain free to use.
A SendGrid account, sign up for free to send up to 40,000 emails for the first 30 days.
Prerequisites for the app
Sign In to Backbench account.
Select +, in the upper right corner to create a Bench. For example, say "bench_one" and select CREATE or hit Enter.
Frontend
Select +, in the upper right corner of file manager to create a html file. For example, say "index.html" and select CREATE or hit Enter.
Copy and paste the code module from below.
Select save.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>mail service</title>
</head>
<body>
<div id="contact">
<h1>Send an email</h1>
<form action="/sg" method="post">
<fieldset>
<label for="from">From:</label>
<input type="text" id="from" name="from" placeholder="From email_id" />
<label for="Toemail">Email:</label>
<input type="email" id="email" name="email" placeholder="Enter your email address" />
<label for="subject">subject:</label>
<input type="subject" id="subject" name="subject" placeholder="subject" />
<label for="message">Message:</label>
<textarea id="message" placeholder="Message" name="message"></textarea>
<input type="submit" value="Send message" />
</fieldset>
</form>
</div>
</body>
</html>Adding Dependencies
For nodejs only.
Create a module name package.json and paste following code.
Backend
Select +, in the upper right corner to create a Module. For example, say "Send_email.js" and select CREATE or hit Enter.
Copy and paste the code module from below.
Replace an API key from SendGrid setting section (create a new api key using create button).
Select save.
Last updated