how to send Emails from a Google Doc

how to send  Emails from a google Doc

https://www.google.com/docs/about/

Create a new empty Spreadsheet
Add a few rows of data. Every row should contain an email address in column A and the email message to be sent to that person in column B.
For testing purposes, you may want to use your own email address in column

Open the Script Editor by clicking on the 'Tools' menu, then select 'Script editor...'.
Copy and paste the following script:

function sendEmails() {
  var sheet = SpreadsheetApp.getActiveSheet();
  var startRow = 2;  // First row of data to process
  var numRows = 2;   // Number of rows to process
  // Fetch the range of cells A2:B3
  var dataRange = sheet.getRange(startRow, 1, numRows, 2)
  // Fetch values for each row in the Range.
  var data = dataRange.getValues();
  for (i in data) {
    var row = data[i];
    var emailAddress = row[0];  // First column
    var message = row[1];       // Second column
    var subject = "Sending emails from a Spreadsheet";
    MailApp.sendEmail(emailAddress, subject, message);
  }
}

Save the Script
Select the function sendEmails in the function combo box and click "Run"
Check out your email Inbox. Messages are usually immediately delivered, but sometimes it takes a few seconds.

Previous Post Next Post