使用UTF-8编码的网页创建包含瑞典语字符的Outlook邮件 [英] Creating Outlook mail with Swedish characters from UTF-8-encoded webpage

查看:171
本文介绍了使用UTF-8编码的网页创建包含瑞典语字符的Outlook邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用PHP编写的数据库驱动的网站,需要从数据中创建电子邮件。所有数据和每个页面都以UTF-8编码,并包含大量瑞典字符åäö。我的mailto-link中有以下内容:

I've got a database-driven website, written in php, which needs to create e-mails from the data. All data and every page is encoded in UTF-8, and contains plenty of the Swedish characters åäö. I've got the following in my mailto-link:

<a href="mailto:name@domain.com?body=Hej!%0D%0AåäöÅÄÖ">Mailto-link</a>

并且电子邮件正文应该是

and the e-mail body is supposed to come out as

Hej!
åäöÅÄÖ

这至少可以使用Internet Explorer 8和Firefox(尚未测试过)使用Outlook 2007的Chrome或Safari。但是,在Internet Explorer 7或更早版本中,åäö作为奇怪的角色出现。我们的许多客户都坚持使用IE 6和7.有关如何使这项工作的任何建议吗?

This works using Internet Explorer 8 and Firefox at least (haven't tested in Chrome or Safari) with Outlook 2007. However, in Internet Explorer 7 or earlier the åäö comes out as weird characters. Many of our clients are stuck with IE 6 and 7. Any suggestions on how to make this work?

推荐答案

我认为这很糟糕可能的浏览器/电子邮件客户端组合的数量,如果您尝试使用mailto:链接解决它,将会给您带来无尽的悲伤。理论上url编码应该可行,但是当我在过去涉及这个时,我发现从PHP发送电子邮件更容易。

I think the wast number of possible browser/email client combinations out there is going to give you an endless amount of grief if you try to solve it with a "mailto:" link. Theoretically url-encoding should work, but when I've dabbled with this in the past I figured out it was easier to just send email from PHP in stead.

带来的但是,其他挑战,例如确保您不会让垃圾邮件发送者将您的服务器用作电子邮件网关(例如,使用联系人ID号而不是表单中的电子邮件地址)。 Captcha和速率限制也可能是一个好主意。

That brings other challenges though, such as making sure you don't make it possible for spammers to use your server as an email gateway (eg. use contact ID numbers in stead of email addresses in the form). Captcha and rate limiting is probably a good idea as well.

这篇关于使用UTF-8编码的网页创建包含瑞典语字符的Outlook邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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