drupaldrupal-6hyperlink

Drupal - use l or url function for mailto links


Does anyone know how to use the l() or url() function to create mailto links?

I am running drupal 6.


Solution

  • You need to use the absolute option:

    l('Mail me', 'mailto:jim@hotmail.com', array('absolute' => TRUE));
    

    will generate

    <a href="mailto:jim@hotmail.com">Mail Me</a>