在 mailto 正文中插入换行符 [英] Insert a line break in mailto body

查看:56
本文介绍了在 mailto 正文中插入换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的 mailto 正文中插入一个换行符.我尝试了 %0A、%0D 和 %0D%0A.没有什么对我有用.我在 Mac OSX 上使用 Google Chrome 在 Gmail、Yahoo、Apple Mail、Outlook 2010、Outlook.com 和 Thunderbird 上进行了测试.

I would like to insert a line break into my mailto body. I tried %0A, %0D and %0D%0A. Nothing worked for me. I tested on Gmail, Yahoo, Apple Mail, Outlook 2010, Outlook.com and Thunderbird with Google Chrome on Mac OSX.

有什么帮助吗?

这是我的代码:

<a href="mailto:email@mycompany.com?subject=Subscribe&body=Lastame%20%3A%0D%0A%20Firstname%20%3A"><img alt="Subscribe" class="center" height="50" src="subscribe.png" style="width: 137px; height: 50px; color: #4da6f7; font-size: 20px; display: block;" width="137"></a>

推荐答案

我建议您尝试使用 html 标签
,以防您的营销应用程序能够识别它.

I would suggest you try the html tag <br>, in case your marketing application will recognize it.

我使用 %0D%0A.只要电子邮件是 HTML 格式,这应该有效.

I use %0D%0A. This should work as long as the email is HTML formatted.

<a href="mailto:email@mycompany.com?subject=Subscribe&body=Lastame%20%3A%0D%0AFirstname%20%3A"><img alt="Subscribe" class="center" height="50" src="subscribe.png" style="width: 137px; height: 50px; color: #4da6f7; font-size: 20px; display: block;" width="137"></a>

您可能希望在名字之前去掉 %20,否则您将在下一行的第一个字符处有一个空格.

You will likely want to take out the %20 before Firstname, otherwise you will have a space as the first character on the next line.

请注意,当我用您的代码对此进行测试时,它起作用了(以及一些额外的间距).您使用的是不允许 HTML 格式的邮件客户端吗?

A note, when I tested this with your code, it worked (along with some extra spacing). Are you using a mail client that doesn't allow HTML formatting?

这篇关于在 mailto 正文中插入换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆