Help auto email from Outlook when Google Form submit

nhnn1986

Board Regular
Joined
Oct 12, 2017
Messages
92
Hi All

I found script belove auto email with attachment from Gmail to recipient when Google Form submit

VBA Code:
function email() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName('OneClick');
  var file = DriveApp.getFilesByName('OneClick_HU.xlsx').next()
 
  var recipient = sheet.getRange(sheet.getLastRow(), 4).getValue() + ',' + sheet.getRange(sheet.getLastRow(), 5).getValue();
  var subject   = 'Hello, this is your Excel file';
 
  var name      = sheet.getRange(sheet.getLastRow(), 2).getValue();
  var chinhanh      = sheet.getRange(sheet.getLastRow(), 3).getValue();
  var body      = 'Hallo ' + name + ' - ' + chinhanh +', \r\n please download file';
  MailApp.sendEmail(recipient, subject, body,{attachments: file});
}

My quesion is How to change code Auto email from Outlookwhen Google Form submit (not by Gmail ).
Thanks.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,223,911
Messages
6,175,331
Members
452,636
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top