Site news: New mail link

by Volker Weber

tellafriend.png

I just added a little function that many regulars might miss: You can now mail a link to any post with your own mail client. I chose not to use a form based solution and went with a mailto link. Please comment if you have a client that does not pick up both a subject and body.

2004-10-04 :: email :: bookmark :: digg

Comments

That's awsome. How many times have I; right-click, Properties, select, copy, paste.....

Tim Latta, 2004-10-04 04:59

Great idea. Did you use PHP?

Something that might be of interest to Safari users is adding a javascript bookmarklet to provide 'mailto' functionality for any current browser page.

Add a bookmark, assigning a name of your choice, such as 'mailto' or 'send link'. Set the URL portion of the bookmark to the following (my bookmark is displayed in the bookmarks bar, for convenience):

javascript:location.href='mailto:?SUBJECT='+document.title+'&BODY='+escape(location.href)

Selecting this bookmark will now create a new mail message using the default mail client, with the message subject set to the current page title, and the first line in the message body set to the current page URL. This technique will work in any javascript-enabled browser, on any platform.

David Richardson, 2004-10-04 07:19

Very clever David.
The script works very well for me. Thank you

Jetzt fehlt nur noch ein "send this via iChat" (oder alternativ auch AIM) link. ;-)

gute idee. hab ich auch gleich mal eingebaut.

This is a really neat feature.

Any objection if I add something like this to BlogSphere?

Thanks, Declan. Objections? Of course not!

This new addition broke your XHTML validation. I think a simple <amp; or two can straighten it out, though. Cool idea! I may also st-, er, borrow it.

Very nice.

I'd kinda lke to borrow this as well, if that's ok.

I also, added David's bookmarklet idea to my browser, very handy. However, I wrote it as:
"javascript:void(location.href='mailto:?SUBJECT='+document.title+'&BODY='+escape(location.href))"
with the void() around to prevent it from writing to my window.

Thanks, Andrew

Thanks, Jeff. I did not validate while I should have. You were right: Putting amp; behind the & solved the issue.

Andrew, be my guest. The more people put this on their sites, the more useful it gets. If readers expect to find it the will look around and use it.

Since nobody commented yet about a client that doesn't pick it up:

Browsers.

Not really my problem as I don't use webmail, but this won't work for anyone who uses web based e-mail. Be it in an Internet-Cafe, be it at work if they don't want to send it via their company account, be it because they are at someone elses PC.

You state in your post that it will use the e-mail client, but it's not made clear in the link for every post. Plenty of opportunity for confusion.

And some nitpicking: Your link states "Mail this page". That's wrong, it doesn't send the page (which I would expect with that wording, sending the full text entry), it only sends a link.

Thanks for the feedback, Armin.

I know it does not work with browsers. It might actually work with GMail-Helper but I have not tested.

"Plenty of opportunity" might be a bit blown out of proportion, though.

And finally, yes, I know I am not sending the page. That won't work in a mailto-Link because the URL would be too large. I contemplated sending the first 10 words but decided against that. When I wrote this post, there was not "Mail this page" on the individual archive page. Only the front page and the 30 days archive had them. I might drop "page" to make it look like "Mail this" from the front page, if that helps you.

OK, I exaggerated a bit, especially as most of your readers probably do have their own e-mail client. I'm not a great friend of mailto-links though, in particular the type where they are used with a form. I think I must have spent too much time in the SelfHTML Forum a while ago.

And I haven't tested with The Bat! yet, which I use at home ;-)

In regards to the "mail this page", this was just some nitpicking and may be should have had a smiley. I personally don't really mind what it says, it's just something I noticed. If others have the same expectation from this link description it might disappoint a few people though ;-)

Deceptively simple. And done within one or two minutes in Movable Type. I wonder why I never thought of this before.... Thanks.

Horst, Columbus' egg comes to mind. I quickly stole your "Tell a friend" wording which might satisfy Armin's nitpicking. :-)

Great feature! But TheBat! does not handle the mailto-link properly. It adds to the To: field, to the Subject: field and the body stays blank. Any ideas? Thanks!

Joerg Richter, 2004-10-04 18:07

I'd reconsider the text you add to the body. "Here is a story that might interest you" resembles those standard virus mails. Inserting just the link might be enough.

And changing the title to "Mail the address of this entry to a friend" might solve Armins quest.

Joerg was quicker than me, but this doesn't work at all with The Bat!:

I've got "?subject=vowe" (without the quotes) in my To: field. The subject just reads "vowe" and nothing in the body (well, apart from "Hi ?subject=vowe", because of the macro I use for the salutation).

As far as I know this isn't a standard anyway (it certainly isn't defined in HTML), so it's bound to break with at least a few e-mail clients.

OK, Ladies, let me clarify.

You don't need to think for me. This solution might be broken for some clients, or it might look like a spam message. I want you to test it, because there are a lot of people copying the idea. My spam filter does not flag the message. We also have established that The Bat cannot handle this particular URL, and I happen to know that Notes 4.x won't catch subject and body and Notes 5.x might drop the body. I also know that Mail.app, Thunderbird and Notes 6.x work OK.

How about Outlook and Outlook Express? Mozilla Mail? If we got all those I can live with the few clients that can't handle it. I am not going for a 100%-solution.

From what I can remember Outlook did work as intended ;-)

Works also with Mozilla Mail (1.7.3)

Post a comment











Shall I remember this for you?




Use your full name and a working email address. Unless you want your comment to be removed. No kidding.



Ceci n'est pas un blog

vowe.net is a personal website published by Volker Weber a.k.a. vowe. I am an author, consultant and systems architect based in Darmstadt, Germany.

rss Click here to subscribe

Hello

About me
Contact
Publications
Certificates
Frequently asked questions

Twitter Updates

More >

Poll

Mobile phones on a plane?

Getting poll results. Please wait...

Local time is 23:01

visitors.gif
179 visitors online

News

Other sources of news, imported into my own format to make them more accessible:

Heise Online
Schlagzeilen
Weather

Archives

As most of my articles roll off the front page rather quickly, I am making an archive of previous posts available here. You can also use the handy search box at the top of the page if you are looking for something particular.

Last 30 days
More archives

Got the T-shirt?

Got the T-shirt?
Are you buying from the US?

Systems Architecture

This site runs on an Apache web server on top of the Linux operating system. The content is managed with MovableType 2.661 which is implemented in Perl. Last but not least the HTML code your browser sees is put together with PHP.

© 1992-2008 Volker Weber.
All Rights Reserved.

Impressum