Is there any sense in using the <title> tag in HTML e-mail?

大城市里の小女人 提交于 2020-12-29 08:49:05

问题


When sending an HTML e-mail, is there any sense in using the <title> tag? In the PHP Manual, for instance, they use such a tag in their main sample code. However, I see no reason why an e-mail client would use this title and not the Subject from the e-mail. Is there any reason to set this tag?


回答1:


I've been looking into this myself as I'm writing a PHP mailing list manager script that uses the sendmail() function.

The script allows the admin to create and send multiform emails (both text and html versions).

After much testing I have found that some email servers appear to have issues with the title tag (<title></title>).

I created a test email and sent it to 5 of my email address, my @blueyonder.co.uk email failed to arrive but the 4 others had no problems.

After a process of elimination it turned out that the @blueyonder.co.uk mail servers did not like the title tags in the html part of the email message, when I removed the tag the email arrived no probs.

Very strange!




回答2:


The only use I would see is that some clients, like Outlook, allow you to view an email in a browser for better rendering. It would then be a plus to have the html title tag set.




回答3:


(Old question, I know ;) )

My experience is that some mail clients will display the <title> tag in their email preview and some won't. Some clients preview will be "Subject + <title> + Preheader" and some will only be "Subject + preheader", so that creates an inconsistent experience.

Because of that, I found it's better to only use a preheader.


For completion's sake, the "Preheader" is a hidden text form the body that is only used in the preview, for example, something like...

<div style="display: none; max-height: 0px; overflow: hidden;">
  Insert hidden preheader text here
</div>


来源:https://stackoverflow.com/questions/12237776/is-there-any-sense-in-using-the-title-tag-in-html-e-mail

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!