问题描述
在Google电子表格脚本中使用 MailApp.sendEmail
发送电子邮件 之后的示例: 然而当我触发 我做错了什么? 看看: I'm Trying to send email using The Test web app for your latest code. function works. (email is sent) But when I try to trigger the I'm following the documentation:https://developers.google.com/apps-script/reference/mail/mail-app And yet when I trigger the What am I doing wrong? Looked at: But I want to understand if I am doing something wrong... Full Steps and code: https://github.com/nelsonic/web-form-to-google-sheet#12-google-apps-script In your Google Spreadsheet Script call: As per the docs: https://developers.google.com/apps-script/reference/mail/mail-app#sendemailto-replyto-subject-body For this new functionality to work in your script youwill need to "Save a New Version" and (Re-)Deploy your App! (simply clicking the "Save" is Not Enough!) It's not immediately obvious but you have to click on "Manage Versions..." see: https://developers.google.com/apps-script/guide_versions Then create your new version: Select the latest project version to deploy: Click "OK". No need to update the script url in your HTML form(it does not change - there are pros & cons to this...) For the complete solution see: https://github.com/nelsonic/web-form-to-google-sheet 这篇关于为什么Google电子表格脚本中的MailApp.sendEmail不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! sendEmail()
MailApp.sendEmail
in a Google Spreadsheet Script following this example: https://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/ by @mhawkseysendEmail()
via a POST
request it does not work.sendEmail()
function from my script, it does not send an email.Invoke the
MailApp.sendEmail
MethodMailApp.sendEmail("recipient.address@gmail.com", // to
"sender.name@gmail.com", // from
"Your Subject Goes Here", // email subject
"What ever you want to say"); // email body
Save a New Version of your Script
Re-Publish the Updated Script as a Web App
Done.