如何检测Outlook 2007或2010中是否打开了HTML电子邮件? [英] How can I detect if an HTML email is being opened in Outlook 2007 or 2010?

查看:143
本文介绍了如何检测Outlook 2007或2010中是否打开了HTML电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试为我所在的公司撰写新闻通讯.该新闻稿在所有主要的互联网浏览器(IE 5.55至9,Chrome,Firefox,Opera)中均正确显示,但是当有人在Outlook 2007或2010中打开该新闻稿时,所有字体都看起来被炸掉".

I am currently trying to write a newsletter for the company I work for. The newsletter appears correctly in all major internet browsers (IE 5.55 to 9, Chrome, Firefox, Opera), but when anyone opens it in Outlook 2007 or 2010, all the fonts look "blown up".

我知道这个问题是由于Outlook像Word一样呈现HTML的方式,如果我手动缩小"字体,它们在Outlook中看起来不错,但在任何其他电子邮件软件中都看不到.

I am aware this issue is because of Outlook's way of rendering HTML like Word would, and if I manually "shrink" the fonts, they look good in Outlook but not in any other email software.

我的问题是这个.有没有一种方法可以检测是否在Outlook甚至Word中打开了电子邮件?鉴于Outlook不允许使用JavaScript,因此该解决方案必须采用纯HTML格式.我的计划是检测电子邮件浏览器并动态更改字体(一种if-else).

My question is this. Is there a way to detect whether or not an email is being opened in Outlook, or even Word? Given that Outlook doesn't allow JavaScript, this solution would have to be in plain HTML. My plan would be to detect the email browser and change the font dynamically (a sort of if-else).

谢谢您的帮助!

推荐答案

在Outlook的早期版本(2003年和之下)中,您可以使用IE CSS hacks,但现在不能.

With previous versions of Outlook (2003 and bellow) you could use the IE CSS hacks, now you can't.

与您的问题相关,您无法检测是否正在使用Outlook查看,即使您查看了,也正如我说的,您实际上不能使用条件样式:(

And related to your question, you can't detect if it's being viewed with Outlook and even if you did, and as I said, you can't really have conditional styles :(

我的建议是用像素设置文本样式(我敢打赌,您使用的是点,对吗?).我之所以这样说,是因为我已经完成了几封发送给各种电子邮件客户端的html电子邮件,并且不同电子邮件客户端之间的字体大小相同(或多或少,但至少没有很大不同).

My suggestion is to style the text with pixels (I bet you're using points, right?). I'm saying this because I've done several html emails destined to various email clients, and the font-size is the same (more or less, but at least not very different) between different email clients.

唯一无法样式化的是缩小/减小行高. Outlook不允许这样做.另外,样式应设置为内联.

The only thing that won't be possible to style is shrinking/reducing line-height. Outlook doesn't allow that. Also the style should to be set inline.

这篇关于如何检测Outlook 2007或2010中是否打开了HTML电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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