mailto link with HTML body

前端 未结 10 1926
攒了一身酷
攒了一身酷 2020-11-21 22:26

I have a couple of mailto links in a HTML document.


Can I insert HTML formatted body in the <

10条回答
  •  梦谈多话
    2020-11-21 23:20

    Whilst it is NOT possible to use HTML to format your email body you can add line breaks as has been previously suggested.

    If you are able to use javascript then "encodeURIComponent()" might be of use like below...

    var formattedBody = "FirstLine \n Second Line \n Third Line";
    var mailToLink = "mailto:x@y.com?body=" + encodeURIComponent(formattedBody);
    window.location.href = mailToLink;
    

提交回复
热议问题