如何将 HTML 页面嵌入到 Outlook 和 Gmail 电子邮件正文中?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24366665/
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
How to embed HTML page into outlook and gmail email body?
提问by user2173295
I am trying to embed my HTML page into 'outlook' and Gmail email body. I am creating a survey tool where the email contains radio buttons and submit button which sends selected data to the server. I have tried to insert the HTML file but it gets displayed as text, please help me with input.
我正在尝试将我的 HTML 页面嵌入到“outlook”和 Gmail 电子邮件正文中。我正在创建一个调查工具,其中电子邮件包含单选按钮和将选定数据发送到服务器的提交按钮。我试图插入 HTML 文件,但它显示为文本,请帮助我输入。
Is there a better way of implementing this?
有没有更好的方法来实现这个?
采纳答案by mygeea
As a quick solution, you can send yourself the email using a free HTML mail editor.
作为一种快速解决方案,您可以使用免费的 HTML 邮件编辑器向自己发送电子邮件。
You have to send it as an HTML, from your webmail provider. There is a free service for that. I use http://ctrlq.org/html-mail/
您必须从您的网络邮件提供商处将其作为 HTML 发送。有一项免费服务。我使用http://ctrlq.org/html-mail/
Otherwise, you have to create and send it yourself.
否则,您必须自己创建并发送它。
回答by Dmitry Streblechenko
Outlook will NOT run any script or submit any HTML forms from HTML emails that it displays.
Outlook 不会运行任何脚本或从它显示的 HTML 电子邮件提交任何 HTML 表单。
回答by Behzad Ebrahimi
Please refer to the following solution.
请参考以下解决方法。
This is core of answer:
这是答案的核心:
Use an html editor (like DreamWeaver, TextWrangler, Coda, or whatever you may have) and create the email in the editor. Then save the file with a “.html” extension. Where you save the file does not matter at all, but it's probably easiest just to save the HTML file on your desktop so you can easily access it in step 2.
Open that html file in an internet browser – Firefox, Safari, Internet Explorer, Google Chrome, etc. If you just click on the file it should just directly open up in a browser, since your computer is smart enough to know that a “.html” file should be opened in a browser. If the file does not open directly in a browser, simply open a browser window, and then in the browser menu go to “File->Open File”, and choose the .html file.
In your browser menu, go to Edit, and then “Select All” or Ctrl+A ( or Command + A if you are on a Mac) to select everything that is displayed in the browser. Copy (Ctrl + C) the now highlighted/selected page.This is the magic step that stores all the HTML onto your clipboard – so make sure you get this one right!
Paste (CTRL + V or Command +V) the html to the Gmail or Yahoo Mail message. Then you are done! This should work like a charm – and you should be able to see the HTML message directly in your message before you send it.
使用 html 编辑器(如 DreamWeaver、TextWrangler、Coda 或任何您可能拥有的)并在编辑器中创建电子邮件。然后使用“.html”扩展名保存文件。保存文件的位置根本无关紧要,但将 HTML 文件保存在桌面上可能是最简单的,这样您就可以在步骤 2 中轻松访问它。
在 Internet 浏览器(Firefox、Safari、Internet Explorer、Google Chrome 等)中打开该 html 文件。如果您只单击该文件,它应该会直接在浏览器中打开,因为您的计算机足够智能,可以知道“. html”文件应该在浏览器中打开。如果文件不能直接在浏览器中打开,只需打开一个浏览器窗口,然后在浏览器菜单中转到“文件->打开文件”,然后选择 .html 文件。
在浏览器菜单中,转到“编辑”,然后“全选”或 Ctrl+A(或 Command+A,如果您使用的是 Mac)以选择浏览器中显示的所有内容。 复制 (Ctrl + C) 现在突出显示/选定的页面。这是将所有 HTML 存储到剪贴板的神奇步骤——所以确保你做对了这一步!
将 html 粘贴(CTRL + V 或 Command +V)到 Gmail 或 Yahoo Mail 邮件。然后你就完成了!这应该像一个魅力——在你发送之前,你应该能够直接在你的消息中看到 HTML 消息。
回答by user2060451
Just type the email you want in gmail. Save it as draft.
只需在 gmail 中输入您想要的电子邮件。将其保存为草稿。
Righ clickand Inspectthe elements you want. Edit your email (Devevoper tools) just like you would do with a website.
右键单击并检查所需的元素。就像处理网站一样编辑您的电子邮件(开发人员工具)。
Save it.
保存。
Email it.
通过电子邮件发送。
Be happy.
要开心。