MailApp specify mailbox sender

倾然丶 夕夏残阳落幕 提交于 2020-01-06 05:36:34

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!