我正在使用谷歌電子表格存儲表單響應。有人工作了一點,但剛剛辭職,現在我收到郵件說我有這樣的錯誤:谷歌表單錯誤
Cannot find method (class)(class)sendEmail(string, string, string, string, object). (line 32, file "Code")
在我的電子表格中的第一列包含時間戳,那麼我的數據後馬上儲存。我已經粘貼下面我的代碼:
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 = "[email protected], [email protected]";
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 >>從電子表格>>在表單提交
您應該避免在互聯網上暴露真實的電子郵件地址,即使在SO上也是如此。 –