Fb.Bē.Ig.In.

How to send an email using a static HTML page with Google sheets free?

Send an email from a static HTML page with Google sheets

In some cases you have an example static sites made with HTML, CSS, and javascript and you might have a contact page on that site.

As you probably are aware a contact page will acknowledge a few fields from clients like his Email, Name, message and afterward save them to the data set. In your backend, you will have a page that can see that contact messages and answer to clients from.

Or then again perhaps you really want to send an email from your site, yet you would rather not utilize any server-side language like php,asp,node.js, or some other language. you need to send an email without utilizing any SMTP server.

In this article or little talk, I will tell you the best way to send an email to your static page utilizing just javascript and google sheets administration.

Step by Step Guide.

1. The first thing you have to do is to open the link below:

Google Sheet Copy Link

2. Click on make a copy. You will see a spreadsheet on front of you.

3. Rename the file if you want.

4. Click on tools > script editor.

5. Go to line number 8, uncomment and send the target email you want to send to.

6. Now save the script then click on file > manage versions > write any description and click on save version.

7. Click on publish > Deploy as a web app.

Make sure to select the project version( in your case must be one) but when you save a different version of the script, select the right one.

And leave access to anyone, even anonymous.

Click update and if it asks for authenticating just click allow.

8.Copy the generated script (we will use this in our page)

9. Now download the test HTML contact page: (we have two examples, one is basic, and the other is an async call to hide the success message)

Download basic example

Download Async example

Open the file and go to this part:

Paste the script link you got from google sheets in step 8 in the action value.

10. Now open the file in the browser and test it, just fill the form and click send.

Check your inbox to see the magic!

Also, every email you send will be recorded in the online google sheet.

This article is based on a GitHub tutorial, check it here.

17 Comments

Leave a Comment