How do I stop Outlook from rendering an email address as a mailto: link?

前端 未结 12 1239
生来不讨喜
生来不讨喜 2021-01-01 13:33

I am creating an HTML email to be sent to a user. If there is a valid email address to within an HTML email, Outlook will render it (normally helpfully) as a mailto: link.

12条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-01 13:57

    I found your question through google, and hours later I found an answer that works for me for the same problem.

    Wrap the email address inside an href with "#" as the target, and set the color to black and text decoration to none. Additionally, put the email address in another font tag, inside the anchor, with font size and type as well.

    Like this:

    
    This e-mail was sent to 
    
    
    [email].
    

    The result is that the email address becomes a clickable link, but 1) it doesn't look like a clickable link and 2) the link doesn't go anywhere nor does it attempt to perform a mailto:

    It's not perfect, but it's good enough for me for now.

提交回复
热议问题