I have script that sends an email from google sheet and want to have link in the email's body but code like

var html_link = "google.com";
var body = "<a href=" + html_link + ">Google</a>"
MailApp.sendEmail(email1,subject ,body, {attachments:[{fileName:"RdS "+datet+ ".pdf", content:contents, mimeType:"application//pdf"}]});

give me same code in email body, not the link. So email body looks like this Google

Where I am wrong?


ok, I learned that you need to apply htmlbody like

var contentHTML = "<body> <font color='red'> <b>SUPERVISOR!</b> \n \n <p> <b> REVISA EL PLAN/FACT DE LA SEMANA</font></b> </p><br> <a href='" + urlsheet + "'>CLICK PARA SIGUIR A LOS REPORTES DEL TURNO</a> </p><br> </body>"
GmailApp.sendEmail(email1,subject ,body, {htmlBody: contentHTML});

now it works

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.