title: Emaling with apps script to non-gmail accounts
body: <pre><code>function onSubmit(e) {
  //.......  
  var NewSpreadSheetID = NewSpreadSheet.getId();
  var File = Drive.Files.get(NewSpreadSheetID);
  var url = File.exportLinks[MimeType.CSV];
  var token = ScriptApp.getOAuthToken();
  var response = UrlFetchApp.fetch(url, {
  headers: {
  'Authorization': 'Bearer' + token
  }
  });
  
  var blobs = [response.getBlob().setName(DirectoryName)];
  
  
  
  
  if (EmailBoolean == "yes") {
  var UserEmail = e.response.getResponseForItem(frm[130]).getResponse().toString();
  var CreatorEmail = Session.getEffectiveUser().getEmail();
  
  MailApp.sendEmail({
  to : UserEmail,
  subject: "Your project spreadsheet",
  attachments: blobs
  });
  }
  
  
  MailApp.sendEmail({
  to : CreatorEmail,
  subject: "Your project spreadsheet",
  attachments: blobs
  });
  }
  </code></pre>
  
  <p>When this email is sent to the non-gmail account, say a hotmail account, the file essentially is attached as a link to a site that redirects the user to log in to a g-mail account.</p>