admin管理员组文章数量:1426506
I have this code to send emails with Google Apps Script:
var message = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua " + name + "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris" + receiver;
MailApp.sendEmail(email2Send, title, message);
But the email that goes to receiver has no formating, no paragraphs, etc. I would apreciate at least paragraphs (new lines) but \n doesn't work. The documentation tells me that:
htmlBody String if set, devices capable of rendering HTML will use it instead of the required body argument; you can add an optional inlineImages field in HTML body if you have inlined images for your email
So, I could do something like this:
...
var options = {
htmlBody: '<b><i>TEST</i></b>'
};
MailApp.sendEmail('[email protected]', 'TEST', 'TEST', options);
...
What are the alternatives do add format to a message using MailApp.sendEmail
? Could you suggest me one simple HTML templates to a basic text format? (I'd like something simpler than this (Gmail) Sending emails from spreadsheet. How to add signature with image?)
I have this code to send emails with Google Apps Script:
var message = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua " + name + "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris" + receiver;
MailApp.sendEmail(email2Send, title, message);
But the email that goes to receiver has no formating, no paragraphs, etc. I would apreciate at least paragraphs (new lines) but \n doesn't work. The documentation tells me that:
htmlBody String if set, devices capable of rendering HTML will use it instead of the required body argument; you can add an optional inlineImages field in HTML body if you have inlined images for your email
So, I could do something like this:
...
var options = {
htmlBody: '<b><i>TEST</i></b>'
};
MailApp.sendEmail('[email protected]', 'TEST', 'TEST', options);
...
What are the alternatives do add format to a message using MailApp.sendEmail
? Could you suggest me one simple HTML templates to a basic text format? (I'd like something simpler than this (Gmail) Sending emails from spreadsheet. How to add signature with image?)
1 Answer
Reset to default 3\n
works.
MailApp.sendEmail("[email protected]","test","multi\nline\ntext");
send a mail with the following body:
multi
line
text
本文标签: javascriptAlternatives to format text of body email using MailAppsendEmailStack Overflow
版权声明:本文标题:javascript - Alternatives to format text of body email using MailApp.sendEmail - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745468320a2659631.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论