0

我见过很多表单电子邮件脚本,但最简单的只有 3 行Name,EmailMessage.

有没有办法可以在脚本中添加更多内容以在其中包含更多行?

4

1 回答 1

1

您应该在这里查看您可以做的所有事情的示例,但如果您正在寻找一种方法来布局带有分段符的电子邮件。这是一种显示更复杂的消息正文的方法:

 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); 
于 2012-09-05T23:13:48.550 回答