I am using a google script attached to a google sheet in my Google Drive to send emails. I have noticed that MailApp.sendEmail() sends emails with a body that have doesn\'t quit
I might need to fine tune details, but as suggested the following works for me. The text.replace
is needed to make the line breaks I might put in intentionally to appear in the html email.
function sendTestEmail(){
var text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
var htmlText = text.replace(/\n/g,'\n<br>');
MailApp.sendEmail({
to: "test@gmail.com",
subject: "test",
htmlBody: htmlText,
});