MailApp.sendEmail从特定别名发送邮件

时间:2014-04-03 06:25:24

标签: google-apps-script google-sheets

是否有一种方法可以通过MailApp.sendEmail函数使用特定用户提到的别名发送邮件。

例如:收件人应该看到邮件来自XYZ@gmail.com而不是我的实际登录邮件ID:

提前致谢

1 个答案:

答案 0 :(得分:0)

如果它的任何类似于在php中发送电子邮件的方式,那么你应该能够设置标题,我见过的几乎所有电子邮件客户端都接受它作为包括iphone和outlook的来源:

$to = 'guyImsendingto@gmail.com';
     $title = "A ghost from the future";
     $desc = "I have sent an email from the future, from me, to me. Listen, we must not go out this weekend!! Trust us, stay in and away from .. THAT PLACE";
     $headers = 'From:XYZ@gmail.com' . "\r\n";
     mail($to, $title, $desc, $headers);
     echo "Done";