Line break and hyperlinks with custom text

138 views
Skip to first unread message

Daniel

unread,
Jan 6, 2023, 10:24:51 AM1/6/23
to Google Apps Script Community
Hello everyone i was wondering how i could make a line break and a hyperlink with custom text like this link A link to google in mailapp

cbmserv...@gmail.com

unread,
Jan 6, 2023, 3:03:12 PM1/6/23
to google-apps-sc...@googlegroups.com

Have MailApp send the email as an html format.

 

To cause a Line breaks use: <br>. Just enter it into the text at the right place.

 

For links, check this webpage:  https://www.w3schools.com/html/html_links.asp

 

It will show you how to code the link and text for it.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/3ebdb9d6-4310-4072-b8d3-1b62b1224414n%40googlegroups.com.

Daniel

unread,
Jan 6, 2023, 3:33:41 PM1/6/23
to Google Apps Script Community
Oh i can use html thats good as i know how to code html

cbmserv...@gmail.com

unread,
Jan 6, 2023, 3:43:13 PM1/6/23
to google-apps-sc...@googlegroups.com

Yes, invoke the mail send this way:

 

  MailApp.sendEmail({

    torecipient,

    subjecttitle,

    htmlBodymessage});

Daniel

unread,
Jan 6, 2023, 3:48:46 PM1/6/23
to Google Apps Script Community
Oh thanks for the sample code i was wondering why my code wasnt having it

Daniel

unread,
Jan 6, 2023, 3:52:32 PM1/6/23
to Google Apps Script Community
Tried it dosent like @gmail.com 

cbmserv...@gmail.com

unread,
Jan 6, 2023, 4:13:35 PM1/6/23
to google-apps-sc...@googlegroups.com

All of the fields need to be strings. Here is more sample code:

 

function sendEmail()

{

  var message = "<p>Here is the text of the email.</p>";

  var title = Email Title";

  var recipient = m...@gmail.com";

Reply all
Reply to author
Forward
0 new messages