mailto fails in IE where there is a long body text. Is there any way to resolve this?

后端 未结 5 1617
清酒与你
清酒与你 2020-12-03 03:26

I am having a problem using Internet Explorer 8 (IE8) to open mailto links with long messages.

After the user clicks on the link, IE changes to an about:blank page

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-03 04:25

    I too ran into this problem with IE8. Amazing that this is happening; it seems like a problem we'd have run into circa 1998!

    Anyway, I did some testing and came up with a workaround that uses Javascript:

    Send Email
    

    Then define this script:

    
    

    For whatever reason, IE has no problem "forwarding" to long URLs (my testing scenario uses 800+ characters). In cases with multiple mailto links, you could define multiple URL variables and send a parameter into doMailto() that lets it switch to the appropriate one.

    Is it ugly? You bet. But it works in a pinch.

提交回复
热议问题