我见过很多表单电子邮件脚本,但最简单的只有 3 行Name
,Email
和Message
.
有没有办法可以在脚本中添加更多内容以在其中包含更多行?
我见过很多表单电子邮件脚本,但最简单的只有 3 行Name
,Email
和Message
.
有没有办法可以在脚本中添加更多内容以在其中包含更多行?
您应该在这里查看您可以做的所有事情的示例,但如果您正在寻找一种方法来布局带有分段符的电子邮件。这是一种显示更复杂的消息正文的方法:
var body = "Dear User,";
body += "\n\nWe have received your Email.";
body += "\n\nWe need samples of your work (scripts, portfolio, photos, DVDs) to complete your file.";
body += "\n\nPlease either mail or email your samples to us. Our contact information is below.";
body += "\n\nPlease do not hesitate to contact us if you have any further questions.";
body += "\n\nThank you,";
这\n\n
是返回两次的方式。您也可以使用\n
简单地返回一次。您可以使用其他高级参数,如下所示:
var ccList = "me@me.com";
var mailReplyTo = "me@me.com";
var emailName = "ME!";
var optAdvancedArgs = {replyTo:mailReplyTo, bcc:ccList, name:emailName};
MailApp.sendEmail(userEmail, subject, body, optAdvancedArgs);