Issue with mailto link in email address containing ampersand?

前端 未结 1 1907
情深已故
情深已故 2021-01-17 10:50
相关标签:
1条回答
  • 2021-01-17 11:17

    Percent encoding the string is required for IE and I assume will work across browsers. From this MSDN document:

    Windows Internet Explorer 7 and later. You must percent-encode all URL-reserved characters within a mailto: address. For example, the number sign (#) is used as a fragment identifier in URLs. When processing an address such as some#one@example.com, Internet Explorer copies only the portion up to the number sign into the mail client; the fragment portion including the number sign is ignored. This behavior is by design.

    So you need

     <a href="mailto:a%26b_admin%40xyz.com">
    

    As said, I expect a percent encoded address will work in all browsers, but I don't know for sure. I can confirm it works with Chrome and Thunderbird.

    0 讨论(0)
提交回复
热议问题