Search code examples
macoswysiwygmailtoobout

Mac computers aren't processing mailto: links correctly when they have // in them (mailto://)


Sorry for the question title, it's a little difficult to phrase in my opinion. Here is the full question:

The WYSIWYG HTML editor we use on our websites includes a // in the mailto: link when inserted into the text editor box (mailto://). We are a webfirm and use this editor on many, many websites. For example, all the mail links inserted appear like this:

<a href="mailto://[email protected]">Text Here</a>

We just noticed this morning that Windows computers do not include the // in the To: field when clicked regardless of the email client it's opened with. It will include the email as normal ([email protected]).

However, Mac computers are including the // though, so whenever someone tries to send an email using these links, it's trying to email //[email protected] - which isn't delivering, because obviously it's an invalid format with the //s.

Does anyone have any knowledge to why this is happening? The WYSIWYG editor we are using is obout. If we have to go back and remove these // from every single website we've built, it would be a tremendous task. I'm just wondering why Macs seem to not process the link correctly, while Windows computers do.


Solution

  • The Macs are processing the link correctly. Windows is incorrectly removing data and your editor is incorrectly encoding the data.

    The mailto: URL scheme is defined by RFC 2368. It defines it as:

     mailtoURL  =  "mailto:" [ to ] [ headers ]
     to         =  #mailbox
     headers    =  "?" header *( "&" header )
     header     =  hname "=" hvalue
     hname      =  *urlc
     hvalue     =  *urlc
    

    "#mailbox" is as specified in RFC 822 [RFC822]. This means that it consists of zero or more comma-separated mail addresses, possibly including "phrase" and "comment" components. Note that all URL reserved characters in "to" must be encoded: in particular, parentheses, commas, and the percent sign ("%"), which commonly occur in the "mailbox" syntax.

    There is no provision for removing characters such as /.