HTML "mailto" code with hyperlinks |
HTML "mailto" code with hyperlinks |
hodgsonmatt |
Aug 3 2016, 10:10 PM
Post
#1
|
Group: Members Posts: 1 Joined: 3-August 16 Member No.: 24,500 |
Hi - I'm trying to create an email template that contains hyperlinks, but I know that nesting <a> tags is illegal in html.
Trying to figure out a way where I can create the body of the email and include two additional hyperlinks that the user will receive in their email and click on to take them to the respective web pages. Any help would be appreciated! |
pandy |
Aug 4 2016, 06:14 AM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 |
It's actually worse than that. All characters that aren't allowed in URLs need to be escaped, URL encoded. For example spaces need to be replaced with %20. That goes for normal http:// links too, not only mailto links.
A link like this: CODE <a href="http://htmlhelp.com">Get HTML help!</a> Needs to be rewritten like this: CODE %3Ca%20href=%22http%3A%2F%2Fhtmlhelp.com%22%3EGet%20HTML%20help!%3C/a%3E Here's a page with some explanations and a thingamajig that helps with the rewriting. http://www.blooberry.com/indexdot/html/top...urlencoding.htm |
Christian J |
Aug 4 2016, 06:22 AM
Post
#3
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
I don't understand, why would the OP need to nest links, or put URL-encoded markup in the URL?
|
pandy |
Aug 6 2016, 06:46 AM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 |
It's a mailto link with a link in the body of the email. But you are right, I don't think you can send HTML mail with mailto, so just the URL with :// escaped with %3A%2F%2F should be fine.
CODE http%3A%2F%2F.htmlhelp.com |
Christian J |
Aug 6 2016, 07:10 AM
Post
#5
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
|
pandy |
Aug 6 2016, 07:40 PM
Post
#6
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 |
Well, you can't. Not a HTML link. But an URL that just about every email client will turn into a link...
I didn't think about that it was a HTML link in the OP's example to begin with. I just went for the escaping. |
Christian J |
Aug 7 2016, 11:27 AM
Post
#7
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
No, I meant inserting even plain text in the email body through the URL. I only knew about inserting a subject line. Are these things better supported today than the FAQ says? http://htmlhelp.com/faq/html/links.html#mailto-subject
And what if the user has no email client, and instead copies such a mailto URL (with body text) and pastes it into the recipient field of a new email at some webmail service like GMail, will the email still work? |
pandy |
Aug 7 2016, 01:40 PM
Post
#8
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,731 Joined: 9-August 06 Member No.: 6 |
I haven't seen any statistics about that, but I think it's fair to assume today's email clients support the standard options. I.e. cc, subject and body.
The RFS says this: The user agent interpreting a mailto URL SHOULD choose not to create a message if any of the headers are considered dangerous; it may also choose to create a message with only a subset of the headers given in the URL. Only the Subject, Keywords, and Body headers are believed to be both safe and useful. https://www.ietf.org/rfc/rfc2368.txt Alas I have no idea what "Keywords" refer to since no such header is defined in the RFC. |
Lo-Fi Version | Time is now: 26th April 2024 - 01:38 PM |