Microsoft, others join forces to work on encrypted email protocols


In the world of the Internet, technology is constantly changing. The SMTP technology behind email, however, has not changed much since it was first released a very long time ago. Despite the invention of SMTP SMARTTM to solve this problem, most emails are still unencrypted, and thus open to a man in the middle hack. Luckily though, a team of engineers from Microsoft, Google, Yahoo, Comcast, and other leading companies have been working on a proposal which would cut out the middle man hacker

The proposal which has been submitted to the Internet Engineering Task Force attempts to protect against hackers who want to intercept or modify emails. Under the proposal, when sending emails to a domain that supports SMTP STS,  a technology will automatically check if the email’s destination supports encryption and if the email’s certificate is valid. Essentially, this will ensure that your email is talking to the right server. In the event that anything is seen as invalid, the email should fail to deliver and then tell the user why.

How to Track Downloads & Outbound Links in Google Analytics

Since Google Analytics does not track file downloads, email, telephone or other outbound link clicks automatically, we saw an opportunity to provide this code to the community.

Dynamically Track Downloads & Other External Links

For those who have a lot of links and would like to dynamically detect clicks on links to file downloads, we have provided updated code below.  As before, this code requires the jQuery JavaScript library to be set before the code.

We have updated the code to make it more manageable and easier to extend.  In addition, we are using the jQuery on() method for attaching the click event handler to links.  Since we are using the on() method you will need to use jQuery v1.7+.  If you are using an earlier version of jQuery the .live() method can be used instead.

The primary benefit of using the on() method is performance.  Instead of looping through all ‘a’ elements on a page after the page loads (takes processing power on pages with lots of links), we instead listen for any clicks on the ‘a’ elements and invoke our custom JavaScript on the fly.

Again, feel free to customize this code to suite your needs.  It can be placed in its own .js file and should be placed in the <head> of your pages.  This script automates the following:

  • Tracks file downloads as events for the following extensions: .zip, .exe, dmg, .pdf, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .mp3, .txt, rar, wma, mov, avi, wmv, flv, wav (again feel free to modify the list)
  • Tracks outbound clicks as events if the href value contains http:// or https:// and the domain value doesn’t match the current domain
  • Tracks mailto email clicks
  • Tracks Tel telephone clicks
<script type="text/javascript">
if (typeof jQuery != 'undefined') {
  jQuery(document).ready(function($) {
    var filetypes = /\.(zip|exe|dmg|pdf|doc.*|xls.*|ppt.*|mp3|txt|rar|wma|mov|avi|wmv|flv|wav)$/i;
    var baseHref = '';
    if (jQuery('base').attr('href') != undefined) baseHref = jQuery('base').attr('href');

    jQuery('a').on('click', function(event) {
      var el = jQuery(this);
      var track = true;
      var href = (typeof(el.attr('href')) != 'undefined' ) ? el.attr('href') :"";
      var isThisDomain = href.match(document.domain.split('.').reverse()[1] + '.' + document.domain.split('.').reverse()[0]);
      if (!href.match(/^javascript:/i)) {
    	var elEv = []; elEv.value=0, elEv.non_i=false;
        if (href.match(/^mailto\:/i)) {
          elEv.category = "email";
          elEv.action = "click";
          elEv.label = href.replace(/^mailto\:/i, '');
          elEv.loc = href;
        else if (href.match(filetypes)) {
          var extension = (/[.]/.exec(href)) ? /[^.]+$/.exec(href) : undefined;
          elEv.category = "download";
          elEv.action = "click-" + extension[0];
          elEv.label = href.replace(/ /g,"-");
          elEv.loc = baseHref + href;
        else if (href.match(/^https?\:/i) && !isThisDomain) {
          elEv.category = "external";
          elEv.action = "click";
          elEv.label = href.replace(/^https?\:\/\//i, '');
          elEv.non_i = true;
          elEv.loc = href;
        else if (href.match(/^tel\:/i)) {
          elEv.category = "telephone";
          elEv.action = "click";
          elEv.label = href.replace(/^tel\:/i, '');
          elEv.loc = href;
        else track = false;

       	if (track) {
          _gaq.push(['_trackEvent', elEv.category.toLowerCase(), elEv.action.toLowerCase(), elEv.label.toLowerCase(), elEv.value, elEv.non_i]);
          if ( el.attr('target') == undefined || el.attr('target').toLowerCase() != '_blank') {
            setTimeout(function() { location.href = elEv.loc; }, 400);
            return false;

The script sets download, email and tel link clicks as interaction events while the external site clicks are non-interaction which can be adjusted if desired.

As before, the script will detect if the link is opening in a new window or not and automatically uses setTimeout() for 400ms if you are not. This is to allow time for the hit request to process before taking the user to the new page.

Inline Download & Other External Links Tracking

If you’d rather not use the above method to place a single javascript file on your site and automate the tracking for all link elements, you can use the manual inline approach by tagging each link element individually.  The inline approach can be time consuming and is not scalable.

The original syntax for adding the code inline remains the same.

New window/tab
For links that open a new window or tab (such as using target=”_blank” for example) you will want to use the code below:

<a onclick="_gaq.push(['_trackEvent','Download','PDF','Description']);" 
   href="my-file.pdf" target="_blank">
   Download my file

In current window
For links that open within the same window, replacing the current page, you will want to use the code below:

<a onclick="var that=this;_gaq.push(['_trackEvent','Download','PDF',this.href]);
   return false;" 
   Download my file

These type of links require a slight delay to allow time for the hit request to process before taking the user to the new page.

Detailed Download & External Link Reports

After all of your hard work you will have event tracking reports with neatly organized data around file downloads, external link, email link, and telephone link clicks.  From these reports you can gauge the usage and usefulness of your file downloads and various links.



By diving into the download category and selecting event label as the primary dimension you are able to see a report on all of the individual files downloaded from your site.



Lastly, since events are associated with the page they were fired on, you are able to apply a secondary dimension of page to find out which page contained the download or external link click that occurred.

Crypt and decrypt your email with JavaScript

If you want to publish an email on your site but you want to protect it, I have a simple solution Sorriso



<!DOCTYPE html>
<html xmlns="">
    <script src="crypto.js"></script>
    <script src="uncrypto.js"></script>
    <h1>JavaScript eMail Encrypter</h1>

    <p>You can encrypt mailto: links on a website, so that spiders can't detect them, with a simple javascript.</p>
    <p>Example: <a href="javascript:linkTo_UnCryptMailto('nbjmup;spttjojAftjb/dp');">rossini [at] esia [dot] co</a></p>

            <div class="container">
                <div class="desc">enter your eMail address:</div>
                <div><input type="text" name="emailField" size="40" maxlength="255" /></div>

            <div class="container">
                <div class="desc"><input type="button" name="ecrypt" value="Crypt eMail Address" onclick="CryptMailto()" /></div>

                    <br />
                    <br />

                    <div class="container">
                        <div class="desc">crypted eMail:</div>
                        <div><input type="text" name="cyptedEmailField" size="40" maxlength="255" /></div>

                    <div class="container">
                        <div class="desc">html code:</div>
                        <div><textarea name="HTMLCyptedEmailField" cols="50" rows="8"></textarea></div>

Crypt (js)

function CryptMailto() {
    var n = 0;
    var r = "";
    var s = "mailto:" + document.forms[0].emailField.value;
    var e = document.forms[0].emailField.value;

    e = e.replace(/@/, " [at] ");
    e = e.replace(/\./g, " [dot] ");

    for (var i = 0; i < s.length; i++) {
        n = s.charCodeAt(i);
        if (n >= 8364) {
            n = 128;
        r += String.fromCharCode(n + 1);

    document.forms[0].cyptedEmailField.value = r;
    document.forms[0].HTMLCyptedEmailField.value = "<a href=\"javascript:linkTo_UnCryptMailto('" + r + "');\">" + e + "</a>";

Decrypt (js)

function UnCryptMailto(s) {
    var n = 0;
    var r = "";
    for (var i = 0; i < s.length; i++) {
        n = s.charCodeAt(i);
        if (n >= 8364) {
            n = 128;
        r += String.fromCharCode(n - 1);
    return r;

function linkTo_UnCryptMailto(s) {
    var a = document.createElement('a');
    a.href = UnCryptMailto(s);
    document.body.appendChild(a); // Add to the DOM;
    document.body.removeChild(a); // Remove it back


Happy coding!

Auto Fill Email Subject and Body

If you're using a list management system that requires specific text to be placed within the email subject or body of your email, this HTML code is for you.

Many times, if you request your visitors to type in a specific email subject or body text in order to subscribe to your publication, they may not type the required text correctly. This mistake will cause you to lose your subscriber, as your system will reject the subscription request.

To prevent this problem, you can create an email link that will automatically fill in the subject line and body when clicked on.

<a href=" for Tips and Tricks section is great
&">Send me an email</a> trasformare qualsiasi articolo in una esperienza di lettura

Navigando in internet molto spesso troviamo degli articoli che desideriamo conservare o che vorremmo semplicemente leggere meglio. Per questo è nato il sito che in modo molto semplice consente di convertira qualsiasi pagina web in un documento ben visibile che può essere letto da qualsiasi dispositivo, ovviamente anche il Kindle per il quale c'è una funzione specifica.

Per funzionare devi installare un semplicissimo programma che puoi scaricare direttamente dalla home page del sito se utilizzi un browser diverso da Internet Explorer. Ad esempio utilizzando FireFox vengono aggiunte tre icone vicino alla barra degli indirizzi come nell'immagine qui sotto.

Per utilizzarlo con Internet Explorer è necessario invece aggiungere ai preferiti le tre funzioni principali (o quelle che ritieni utili). Le funzioni in ogni caso offerte sono tre:

  • Read Now: quando sei su una pagina che ti interessa leggere bene, clicca su questo pulsante o link e al centro dello schermo compare il disegno di un libro che indica l'inizio della conversione della pagina in un contenuto leggibile. Se sei iscritto al sito, tutto i link saranno conservati e li potrai visualizzare successivamente.
  • Read Later: cliccando su questo pulsante o link invii l'indirizzo della pagina al server che processa la pagina e quando vuoi lo troverai nel tuo account convertita
  • Sent to Kindle: la pagina che stai guardando viene convertita ed inviata tramite email al tuo Kindle.

Il risultato è molto interessante. Ho aggiunto la barra di Readability su questo sito per aiutare tutti quelli che desiderano leggere meglio i nostri contenuti ma anche diffonderli. Infatti tutte le pagine visualizzate vengono raccolte nella propria pagina dove viene anche indicato il link dal quale ogni articolo è stato preso: può riultare utile anche per diffondere i contenuti del proprio sito. Inoltre viene dichiarato che il 70% dei fondi raccolti vengono distribuiti verso tutti coloro che pubblicano informazioni.

Il risultato della conversione di questo post viene così:

La barra grigia laterale consente di aumentare il carattere, mettere nei preferiti un documento, condividerlo sui social network, stamparlo o inviarlo al Kindle. Le modifiche ad una pagina web non vengono però rilevate ed anche se si clicca su "Read Now" viene visualizzata la prima pagina convertita.

Da oggi tutti in tutti i post troverai la barra per la conversione immediata con Readability.



Planet Xamarin

Planet Xamarin