0

Is it possible to send an email via Google Apps Script's MailApp class that would send the email from an existing (non Gmail) mailbox?

Currently, when I trigger an email from the code below, the email actually comes from a random Google server that is spoofing as the user triggering the email. I would like the email to be sent directly by a mailbox within my organization, if at all possible.

MailApp.sendEmail({
     to: 'example@yahoo.com',
     name: 'Jane Doe',
     replyTo: 'example@google.com',
     subject: 'Test',
     body: 'Testing'
});
Carson Taylor
  • 45
  • 1
  • 4
  • Possible duplicate of [It it possible to change the from address when using sendEmail?](https://stackoverflow.com/questions/13885290/it-it-possible-to-change-the-from-address-when-using-sendemail) – tehhowch Mar 14 '18 at 22:19

1 Answers1

1

The short answer is no.

Is it possible to change the FROM address using GmailApp.sendEmail? Yes. You'll have to create an alias, then use getAliases() in your server script. For more detailed instructions, refer to previous answers to similar questions.