Capturing “mailto:” Metrics

I’m on a project where we need to collect metrics around a function named "Share a Story."  The idea is very simple — if you’re looking at an interesting article on the intranet and want to share it with someone, click a link labeled "Share this story" email it to your buddy.

We played around with a custom form for this purpose, but in the end, common sense won the day and we just use the familiar <a href=mailto:…> technique.  (<a href mailto:…> is a surprisingly robust little bit of HTML; as a bonus, that link brings me back to my old UNIX man pages days; those were the days!).

This technique provides a great interface for end users since they get to use their familiar MS Outlook client (or whatever email client they have installed).

It makes things harder on us poor developer types since they client *also* wants to run a report in the future that shows how often users share stories and even which stories are shared most often.

We whiteboarded a few potential solutions.  My favorite is to carbon copy (CC) a SharePoint list.  That way, the end user still gets the outlook client while we get to capture the event because we’ll get a copy of the email ourselves.  There are some obvious drawbacks.  The main problem is that the user could simply blank out or otherwise mangle the CC address.  And, we need to manage that event library of emails.  We have a scheduled job on the white board responsible for that cleanup.

If you have some clever approach to solving this problem, please do tell.


Subscribe to my blog.

Follow me on Twitter at

5 thoughts on “Capturing “mailto:” Metrics

  1. Chunmun Sharma

    Hi Paul,
    If requirement is to just capture the number of time user share the article then
    Just create 1 custom meta field in the list and when user click on Share a Story link then call 1 javascript function in which developer write a code on that code generate asynchornous call using XMLhttpRequest object and increment the counter by 1 of that article .
    If developer is working on custom web part then he will cretae Server side Hyperlink type control and execute their code and increment the count by 1 of that article and open the outlook.

    If requirement is to capture all the details like recipient list , date , edited message then
    this option will not work , then developer need to create a webpage which look like OUTLOOK interface and capture all details on Send button code

  2. Mike Birtwistle

    How about this?
    * Create the send to link that links to a _layouts page and add the current page to the querystring.
    * On the _layouts page, write the usage info to a Sp List or a DB table.
    * Use the Outlook.Application namespace to create the message and then use objMail.Display() to open a new mail message in outlook – see
    * Then server.transfer back to the original page or to a thank you window

  3. Paul Galvin

    Daniel, that’s another option on the white board. The risk is like you say — what happens if the user cancels the action? It’s technically harder too since we need to write some web service for the javascript to call into.

    What would an href link like that look like? <a href="javascript:[stuff goes here]> … hows does that work?

    Thanks for the suggestion!

  4. Daniel

    How about using javascript (with a tool like JQuery) to catch the user click event on the link. This would fire off an ajax call (again easy to do with jquery) that could log the username, or anything else that you want. I guess the only problem is then you don’t *really* know if the email was sent or not.


Leave a Reply

Your email address will not be published. Required fields are marked *