Hacker News new | ask | show | jobs
by toast0 1042 days ago
You can certainly put urls into a text/plain email. It helps if your urls aren't terribly long and don't have characters that are questionable in urls.

w3c suggests surrounding them with angle brackets [1], but I can't find a source that makes more than a suggestion. By reports, some mail user agents, and some users will include the trailing > in the url they provide to their web user-agent, so that's something to consider and make sure the destination of the link can handle.

Putting links on a line by themselves works well too.

If you don't know what a user prefers, it makes sense to send a text/plain with links as I've described, as well as a text/html with links in tags, because tagged links may be friendlier to some users and some mail user-agents are tragically bad at their job.

[1] https://www.w3.org/Addressing/URL/5.1_Wrappers.html

1 comments

Yes, you can put them in there, but then you're relying on the recipient's client to turn that plaintext url into a link the recipient can actually click on, as opposed to having to copy and paste the url into their browser address bar.

Right? Or do I have something wrong?

Yeah, but most email clients do linkify urls in text/plain emails. Heck, an awful lot of email clients linkify urls in text/html emails.
All the mail clients I use support this, including URLs that wrap onto new lines. Yet I still receive some emails with broken links if they wrap onto new lines. Somewhere along the way, these break before getting to my mail client. I never experience this with HTML email.

If you send long URLs – for instance password reset links with tokens in them – then you need to send them with an HTML part if you want them to be as reliable as possible. Leaving long URLs at the mercy of not just mail clients but the entire mail transmission apparatus, cannot be relied upon.