I'm sending emails using sendEmail function from google sheets and the emails arrive showing the sender as the prefix of my email address (before the @ sign) instead of my gsuite account name, as they do when sending an email manually. Is there a way to change the from field?
function sendEmail() {
var ss = SpreadsheetApp.getActiveSpreadsheet()
var sheet1 = ss.getSheetByName('Sheet1');
var sheet2 = ss.getSheetByName('Sheet2');
var subject = sheet2.getRange(2, 1).getValue();
var n = sheet1.getLastRow();
for (var i = 2; i < n + 1; i++) {
var emailAddress = sheet1.getRange(i, 2).getValue();
var name = sheet1.getRange(i, 1).getValue();
var message = sheet2.getRange(2, 2).getValue();
message = message.replace("<name>", name);
MailApp.sendEmail(emailAddress, subject, message);
}