将网页 html 转换为电子邮件 html

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9761412/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 23:13:26  来源:igfitidea点击:

Convert web html to e-mail Html

htmlcssxhtmlnewsletter

提问by themhz

I was wondering, if there is software out there that can convert an (web html css) to (e-mail html inline css) file, in order to be viewable from most e-mail clients like outlook, Thunderbird or webmails like gmail,yahoo,hotmail etc.

我想知道,是否有可以将 (web html css) 文件转换为 (e-mail html inline css) 文件的软件,以便从 Outlook、Thunderbird 等大多数电子邮件客户端或 gmail 等网络邮件中查看,雅虎、hotmail 等

I would like to be able to write my code as I do writing xhtml files and then import that file to the program and convert divs to tables and css to inline styles compatible for e-mail clients.

我希望能够像编写 xhtml 文件一样编写代码,然后将该文件导入程序并将 div 转换为表格,并将 css 转换为与电子邮件客户端兼容的内联样式。

Any suggestions?

有什么建议?

采纳答案by Mikhail

Unfortunately I know of no software that will directly do this. There are features that can be represented in divs that cannot be in tables. Furthermore, it is not trivial to send the actual HTML.

不幸的是,我知道没有软件可以直接做到这一点。有些功能可以在 div 中表示,而不能在表中表示。此外,发送实际的 HTML 并非易事。

email html is somewhat of a dark art as it requires layout techniques that were deprecated (tables for layout) and manually testing on relevant platforms (Yahoo, Google, Thunderbird, Outlook).

email html 有点像黑暗艺术,因为它需要被弃用的布局技术(用于布局的表格)并在相关平台(雅虎、谷歌、Thunderbird、Outlook)上手动测试。

回答by SVS

I use a service by Mailchimpnamed CSS inliner. Its really a nice tool you have to just keep your html & CSS in the same file(no external css file). I mean to say keep all CSS in your html file inside tag in the . See below:

我使用Mailchimp 提供的名为CSS inliner的服务。它真的是一个不错的工具,您只需将 html 和 CSS 保存在同一个文件中(没有外部 css 文件)。我的意思是说将 html 文件中的所有 CSS 保留在 . 见下文:

<head>    
  <style type="text/css">
      /*Your CSS goes Here*/
  </style>
</head>

Here is the link:http://beaker.mailchimp.com/inline-css

这是链接:http : //beaker.mailchimp.com/inline-css

Hope this will help you. Cheers!

希望这会帮助你。干杯!

回答by Howto

You may try this service http://email.bigutility.com/inline-css-convert. It convert any content from url to inline css.

你可以试试这个服务http://email.bigutility.com/inline-css-convert。它将任何内容从 url 转换为内联 css。

Some key features:

一些主要功能:

  • Support page that has multi external css file.

  • Support CDN (css file that load from CDN server).

  • Support jQuery selector to filter result.

  • HTML Editor (wysiwyg) to edit your inline css page.
  • 支持具有多个外部 css 文件的页面。

  • 支持 CDN(从 CDN 服务器加载的 css 文件)。

  • 支持 jQuery 选择器过滤结果。

  • HTML 编辑器 (wysiwyg) 来编辑您的内联 css 页面。