How it works and more samples

For anonymous users, the macro simply outputs the literal argument text as passed to the macro.

For logged-in users, the macro processes the parameter string as follows:

  1. The following ALL-UPERCASE words will be replaced:
    • AT

      @

      DOT

      .

      DASH

      -

  2. Other ALL-UPPERCASE words like e.g. NO SPAM NOSPAM WHATEVER I DONT WANT SPAM etc. will simply be dropped (replaced by an empty string).
  3. All blanks get removed.
  4. A clickable mailto: link is generated.

There is of course some danger of an especially bright spam bot recognizing usual spam protection words like AT, DOT and NOSPAM and converting them correctly. This is made more unlikely if you sprinkle in arbitrary words and blanks. A spam bot who can even recognize that has well earned your email address. ;)

You can easily see the effects of MailTo by comparing these examples for logged-in and anonymous users:

Markup

Result

<<MailTo(Firstname DOT Lastname AT example DOT net)>>

<Firstname DOT Lastname AT example DOT net>

<<MailTo(Firstname . Lastname AT exa mp le DOT n e t)>>

<Firstname . Lastname AT exa mp le DOT n e t>

<<MailTo(Firstname I DONT WANT SPAM . Lastname@example DOT net)>>

<Firstname I DONT WANT SPAM . Lastname@example DOT net>

<<MailTo(First name DOT I Lastname DONT AT WANT SPAM example DOT n e t)>>

<First name DOT I Lastname DONT AT WANT SPAM example DOT n e t>

<<MailTo(Firstname DOT Lastname AT example DOT net, "Me, Myself, and I")>>

Me, Myself, and I <Firstname DOT Lastname AT example DOT net>

(!) Given the ability to add CAPS words, each user can raise the obstacles for both bots and humans as they desire. If you make it hard for human readers, you will get less mail. ;)