简体   繁体   中英

HTML href Link is not clickable

I want to send the following snippet to my gmail account, however it does not resolve into a clickable link in the email I recieve.

<a href="evernote:///view/XXXXXXX/sXX/f473d94d-ac3d-43d0-a838-0c9f55d622c6/f473d94d-ac3d-43d0-a838-0c9f55d622c6/">Link</a>

Full Code (JavaScript / Google Apps Script)

function test() {
GmailApp.sendEmail("X.X@gmail.com", "Mail Subject", "",{ htmlBody: "<a href='evernote:///view/XXXXXXX/sXX/f473d94d-ac3d-43d0-a838-0c9f55d622c6/f473d94d-ac3d-43d0-a838-0c9f55d622c6/'>Link</a>"} );
};

When I put the snippet into another editor ( eg http://www.w3schools.com/html/tryit.asp?filename=tryhtml_basic ) , the html resolves into a clickable link as it should.

What am I missing here?

(Btw. <a href=" http://www.link.com">Link</a> works fine, so there is a problem with the evernote:/// url type)

网址应带有http://https://

evernote:/// is not a protocol that everybody understands. Even if you put the same link in your browser it will not work. As the previous answer suggests, you must link your href tag to a http:// or https:// protocol.

Although the w3schools page creates a link out of it, nothing happens when you actually click it.

Try this

String body= HttpUtility.HtmlDecode("<a href=\"evernote:///view/XXXXXXX/sXX/f473d94d-ac3d-43d0-a838-0c9f55d622c6/f473d94d-ac3d-43d0-a838-0c9f55d622c6/\">Link</a>"); 

Pass the string body as parameter

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM