Does anyone know how to use the l() or url() function to create mailto links?
I am running drupal 6.
You need to use the absolute option:
l('Mail me', 'mailto:[email protected]', array('absolute' => TRUE));
will generate
<a href="mailto:[email protected]">Mail Me</a>
A good practice is to use the t() function with strings. Code should be then:
l(t('Mail me'), 'mailto:[email protected]', array('absolute' => TRUE));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With