问题
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'
});
回答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.
来源:https://stackoverflow.com/questions/49288450/mailapp-specify-mailbox-sender