Click here to Skip to main content
15,881,281 members
Articles / Web Development / HTML

Send Email from a Static HTML

Rate me:
Please Sign up or sign in to vote.
4.96/5 (11 votes)
9 May 2017CPOL1 min read 33.1K   9   2
How to send email from a static HTML

This post discusses how to send an email without back-end/server side code.

There are many solutions available for sending an email. Here, I am explaining steps to sending an email from an HTML page using Google Apps mail.

1. Make a Copy of the Sample Spreadsheet

Sample: https://docs.google.com/spreadsheets/d/1Bn4m6iA_Xch1zzhNvo_6CoQWqOAgwwkOWJKC-phHx2Q/

1

2. Open the Script Editor

Open the Script editor… by clicking “Tools” > “Script editor…

3

3. Set the TO_ADDRESS in the Script

4

4. Save a New Version of Your Script

Goto File-> Manager Version option to set Version

5. Publish the Updated Script as a Web App

Goto menu Publish-> Deploy as Web app option to publish

Select the latest project version to deploy:

7

6. Authorize the Script to Send Emails

Click Continue to authorize this app:

8

Copy the web app URL to your clipboard / Notepad. Then click “OK”.

10

7. Create Your Basic HTML Form

11

8. Open the HTML Form (page) in Your Browser

Fill in some sample data in the HTML Form:

12

Submit the form. You should see a confirmation that it was sent like:

{"result":"success","data":"{\"color\":[\"\"],\"name\":[\"Rahul\"],
\"message\":[\"This is test \"],\"email\":[\"rahulgbhatia@live.com\"]}"}

Alternate solution: Use Ajax to submit the form

Hope this helps!

Background Reading

Image 9 Image 10

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Advance Web Software
India India
Rahul a self driven software engineer has Masters of Computer Application with knack for taking up any new technology and putting it into application to achieve desired results.His expertise is in Database driven web-applications with Web 2.0 User Interface.

He topped university in his Master course and received various programming awards. He is keen learner, passionate about programming and having good interpersonal and analytical skillset.

Also have good command on : Webservices,Window Service, Ajax, Java Script, Telerik, Subsonic, Entity Framework, CSLA Architecture, Windows Workflow.

Excellent communication, interpersonal, and presentation skills. Ability to learn and adapt to new technologies rapidly.

Comments and Discussions

 
QuestionHow do I change that confirmation message that the message was sent? Pin
Member 1474651216-Feb-20 19:35
Member 1474651216-Feb-20 19:35 
AnswerRe: How do I change that confirmation message that the message was sent? Pin
Member 1571287223-Jul-22 22:45
Member 1571287223-Jul-22 22:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.