Advertisements
Home > ASP.NET, Tips & Tricks > Send Email from a Static HTML

Send Email from a Static HTML


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 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 clip board / note pad. 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 help !

Background Reading

 

Advertisements
  1. Hardik .Net
    May 3, 2017 at 9:02 pm

    Nice

  2. Prem
    May 10, 2017 at 1:18 am

    good

  3. May 12, 2017 at 5:54 am

    The script works fine, but no field content is reaching the script.
    {“result”:”success”,”data”:”{}”}
    Please describe your static-html page like your Home.html.
    Thankx..

    • May 12, 2017 at 6:07 am

      You must need to set id and name attributes of inputs in your html file like following example

      id=”message” name=”message”
      id=”email” name=”email”
      id=”color” name=”color”

      Like or comment if this is helpful

  4. July 11, 2017 at 5:46 am

    . js”>You must need to set id and name attributes of inputs in your html file like following example
    id=”message” name=”message”
    id=”email” name=”email”
    id=”color” name=”color”
    Like or comment if this is helpful

  5. August 14, 2017 at 6:41 am

    . js”>The script works fine, but no field content is reaching the script.

    • August 14, 2017 at 9:28 am

      You must need to set id and name attributes of inputs in your html file like following example
      id=”message” name=”message”
      id=”email” name=”email”
      id=”color” name=”color”
      Like or comment if this is helpful

  6. August 17, 2017 at 4:53 am

    . js”>You must need to set id and name attributes of inputs in your html file like following example
    id=”message” name=”message”
    id=”email” name=”email”
    id=”color” name=”color”
    Like or comment if this is helpful

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: