0

I am trying to send email automaticaly from a SpreadSheet using SheetConverter library.

I have a problem because the function convertRange2html does not maintain borders nor automatic line return (see screenshots)

Here is the formatted Range in SpreadSheet

Here is the formatted Range in SpreadSheet

And here is what I get from email And here is what I get from email

To illustrate, here is a sample of my code :

var emailOrga = ss.getRange("CG5").getValue();
var emailSubject = ss.getRange("B7").getValue();

var mailRange =  ss.getRange("B10:H50");
var htmlBody = SheetConverter.convertRange2html(mailRange);

var mailBody = "Transfère le à tous les participants <br/><br/>" + htmlBody + "<br/><br/>"

MailApp.sendEmail(emailOrga, emailSubject, mailBody, {htmlBody : mailBody});

I would like to know if my format problems come from the code I've written badly, or if anyone has a tool to improve the convertRange2html function?

ItamarG3
  • 4,092
  • 6
  • 31
  • 44
  • requesting off-site resources is considered off topic on stack overflow. – ItamarG3 Jul 31 '17 at 14:52
  • I don't see any error with your code as compared to these SO posts: [1](https://stackoverflow.com/questions/36529890) and [2](https://stackoverflow.com/questions/36837616/send-email-from-a-spreadsheet-with-whole-formatting-and-borders). Make sure that you have added the library properly. Check this [tutorial](https://sites.google.com/site/scriptsexamples/custom-methods/sheetconverter) on how to install the library that can retrieve the contents of a spreadsheet range in plain text or html, preserving the formatting that is present in the spreadsheet. – abielita Aug 01 '17 at 16:08

0 Answers0