Tuesday, March 26, 2019

Sending Emails from Google Spreadsheet

google sheets are more popular nowadays. day by day the use of Apps script is increasing.
we can write the javascript to do anything like a NetSuite.Netsuite is a cloud ERP. it has only javascript development. same as google apps script also will use for all Google products (Apps) in the cloud.
google compute is the best IAAS cloud in the IT industry.

The main points in this article are to "send emails from google sheet". its very simple. and single step to do the above task.
Step 1: Login into Gmail.
Step 2: Go to google drive
Step 3: select the new button and select the spreadsheet
Step 4: type Email and name columns in the spreadsheet.
Step 5: go to tools and select the Script editor
Step 6: write the below script use where ever you want it

                                 MailApp.sendMail(to, subject, body) ;

Sending Emails from Google Spreadsheet

in the above image, you can find the function. the function name is myFunction(){}.

       myFunction()  
                   {
         MailApp.sendMail("alltechgeekz@gmail.com","Hello test mail","Hello from All Tech Geeks");
       
            }

But we need to pick email from the spreadsheet and send the mail from the sheet.

function Send Email() {

                  var sheet =SpreadsheetApp.getActiveSheet();
                  var r   = sheet.getRange("A1:B2");
                   var  customerdata=range.getValues();
for(j in customerdata)
      {
           var row=customerdata[i];
           var Email =row[0];
           MailApp.sendMail(row[1],"Email id is"+Email+,"this is test email");
      }
}

how to get data from the browser to the spreadsheet or how to use the google sheet as a database.
if we get the data from the website or anywhere. then we can do anything with that data.


No comments: