我想在不使用getAliases的情况下手动设置GmailApp对象的'from'高级参数

问题描述

我正在研究Google Scrip,以便通过GmailApp使用基本参数(收件人,主题,正文)发送电子邮件。但是,我想使用高级参数'from',我正在收集电子表格上的电子邮件地址(因此我有发件人发送的电子邮件),因此我想在'from'高级参数上使用该值时刻发送电子邮件。

有什么想法吗?。这是我当前的代码:

  function formSubmitReply(e) {  
  var recipientEmail = '[email protected]';
  var subjectEmail = "New User Form Request";
  //Here is where I'm using the getAliases but is not working and I already have the sender's Email on the spreadsheet
  var fromEmail = GmailApp.getAliases();
  Logger.log(fromEmail);
  //------------------------------------------------------------------------------------------------------------------
  var msg = "<p>Hey IT Team</p>"+
    "<p>A request has been submitted</p></br>"+
      "<p>Test Field: "+e.values[0]+"</p></br>"+
        "<p>Test Field 2: "+e.values[1]+"</p></br>";
  if (fromEmail.length > 0){
  GmailApp.sendEmail(
    recipientEmail,subjectEmail,msg,{
      from: fromEmail[0]
    });
  }else{
   GmailApp.sendEmail(
    recipientEmail,msg);
  }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)