Skip to content Skip to sidebar Skip to footer

Dynamic Mail Id In Mail Service App Of Google Apps Script

I need to send a mail with a default message to the mail id specified by the user in the email field of an html form.I tried the below code which doesn't work.Is anything like URL

Solution 1:

You can retrieve values by adding the name attribute to the input tag. The modified HTML is as follows. In this sample, you can use the value of example@abc.com using e.parameter.addr.

Modified HTML :

<formmethod="POST"action="https://script.google.com/macros/s/AKfycbwIzz6c_PL7D9ioCrzDRvTdmBj2nZR-2ekUZ9pjgHeG3b3Simg/exec"><labelfor="mail">Enter your mailID:</label><inputtype="email"id="mail"name="addr"required><inputtype="submit"></form>

Value e of doPost(e)

{
  "parameter": {
    "addr": "example@abc.com"
  },
  "contextPath": "",
  "contentLength": 22,
  "queryString": "",
  "parameters": {
    "addr": [
      "example@abc.com"
    ]
  },
  "postData": {
    "type": "application/x-www-form-urlencoded",
    "length": 22,
    "contents": "addr=example%40abc.com",
    "name": "postData"
  }
}

If I misunderstand your question, I'm sorry.

Post a Comment for "Dynamic Mail Id In Mail Service App Of Google Apps Script"