0

我正在使用带有存储表单响应的 Google 电子表格。它工作了一段时间,但刚刚退出,我现在收到电子邮件说我有这个错误:

找不到方法(类)(类)sendEmail(字符串,字符串,字符串,字符串,对象)。(第 32 行,文件“代码”)

我的电子表格中的第一列包含时间戳,然后我的数据就存储在它之后。我在下面粘贴了我的代码:

function onFormSubmit(e) {
   var name = e.values[1];
   var department = e.values[2];
   var email = e.values[3];
   var phone = e.values[4];
   var project = e.values[5];
   var title = e.values[6];
   var description = e.values[7];
   var reach = e.values[8];
   var goal = e.values[9];
   var time = e.values[10];
   var work = e.values[11];


  // change this address to be the address where you want the notification to go 
   var to = "dreamsites.designs@gmail.com, nuwish4u@yahoo.com";
   var subject = "Intake Form Notification";
   var message = "Your Name: " + name + "\n \n";
       message += "Department: " + department + "\n \n";
       message += "Email: " + email + "\n \n";
       message += "Phone Number: " + phone + "\n \n";
       message += "Project title: " + title + "\n \n";
       message += "Project description: \n " + description + "\n \n";
       message += "Who are you trying to reach? \n" + reach + "\n \n";
       message += "Are you trying to achieve a specific goal with your communication efforts?  \n" + goal + "\n \n";
       message += "Is this request time sensitive? \n " + time + "\n \n";
       message += "Are you currently working with someone in Marketing & Communications?  \n" + work + "\n \n";
  var mailOptions = {
       name: name,
       replyTo: email,
   };
MailApp.sendEmail(to, subject, message, mailOptions);
}

我的触发器设置为 OnFormSubmit >> 从电子表格 >> On Form Submit

4

1 回答 1

1

我认为这是一个小错字。你能删除不需要的逗号吗mailOptions

var mailOptions = {
       name: name,
       replyTo: email //Removed comma
   };
于 2013-07-02T16:52:14.063 回答