<i id='F5oZ4'><tr id='F5oZ4'><dt id='F5oZ4'><q id='F5oZ4'><span id='F5oZ4'><b id='F5oZ4'><form id='F5oZ4'><ins id='F5oZ4'></ins><ul id='F5oZ4'></ul><sub id='F5oZ4'></sub></form><legend id='F5oZ4'></legend><bdo id='F5oZ4'><pre id='F5oZ4'><center id='F5oZ4'></center></pre></bdo></b><th id='F5oZ4'></th></span></q></dt></tr></i><div id='F5oZ4'><tfoot id='F5oZ4'></tfoot><dl id='F5oZ4'><fieldset id='F5oZ4'></fieldset></dl></div>
  • <small id='F5oZ4'></small><noframes id='F5oZ4'>

      <bdo id='F5oZ4'></bdo><ul id='F5oZ4'></ul>

    1. <legend id='F5oZ4'><style id='F5oZ4'><dir id='F5oZ4'><q id='F5oZ4'></q></dir></style></legend>

      1. <tfoot id='F5oZ4'></tfoot>

        在 html 电子邮件中嵌入图像

        时间:2023-09-20

            <i id='QrYfn'><tr id='QrYfn'><dt id='QrYfn'><q id='QrYfn'><span id='QrYfn'><b id='QrYfn'><form id='QrYfn'><ins id='QrYfn'></ins><ul id='QrYfn'></ul><sub id='QrYfn'></sub></form><legend id='QrYfn'></legend><bdo id='QrYfn'><pre id='QrYfn'><center id='QrYfn'></center></pre></bdo></b><th id='QrYfn'></th></span></q></dt></tr></i><div id='QrYfn'><tfoot id='QrYfn'></tfoot><dl id='QrYfn'><fieldset id='QrYfn'></fieldset></dl></div>

          1. <small id='QrYfn'></small><noframes id='QrYfn'>

          2. <legend id='QrYfn'><style id='QrYfn'><dir id='QrYfn'><q id='QrYfn'></q></dir></style></legend>
                <tbody id='QrYfn'></tbody>
              1. <tfoot id='QrYfn'></tfoot>
                  <bdo id='QrYfn'></bdo><ul id='QrYfn'></ul>

                  本文介绍了在 html 电子邮件中嵌入图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试发送带有嵌入 gif 图像的多部分/相关 html 电子邮件.此电子邮件是使用 Oracle PL/SQL 生成的.我的尝试失败了,图像显示为红色 X(在 Outlook 2007 和 yahoo 邮件中)

                  I'm trying to send a multipart/related html email with embedded gif images. This email is generated using Oracle PL/SQL. My attempts have failed, with the image showing up as a red X (in Outlook 2007 and yahoo mail)

                  我发送 html 电子邮件已有一段时间了,但我现在的要求是在电子邮件中使用多个 gif 图像.我可以将这些内容存储在我们的一台网络服务器上并直接链接到它们,但许多用户的电子邮件客户端不会自动显示它们,并且需要更改设置或为每封电子邮件手动下载它们.

                  I've been sending html emails for some time, but my requirements are now to use several gif images in the email. I can store these on one of our web servers and just link to them, but many users email clients will not show them automatically and will need to either change settings or manually download them for each email.

                  所以,我的想法是嵌入图像.我的问题是:

                  So, my thoughts are to embed the image. My questions are:

                  1. 我在这里做错了什么?
                  2. 嵌入方法是否正确?
                  3. 如果我需要使用越来越多的图片,还有其他选择吗?附件将不起作用,因为图像通常是徽标和图标,在消息上下文之外没有意义.此外,电子邮件的某些元素是指向在线系统的链接,因此无法生成静态 PDF 并附加(据我所知).

                  片段:

                  MIME-Version: 1.0
                  To: me@gmail.com
                  BCC: me@yahoo.com
                  From: email@yahoo.com
                  Subject: Test
                  Reply-To: email@yahoo.com
                  Content-Type: multipart/related; boundary="a1b2c3d4e3f2g1"
                  
                  --a1b2c3d4e3f2g1
                  
                  content-type: text/html;
                  
                      <html>
                      <head><title>My title</title></head>
                      <body>
                      <div style="font-size:11pt;font-family:Calibri;">
                      <p><IMG SRC="cid:my_logo" alt="Logo"></p>
                  
                  ... more html here ...
                  
                  </div></body></html> 
                  
                  --a1b2c3d4e3f2g1
                  
                  Content-Type: image/gif;
                  Content-ID:<my_logo>
                  Content-Transfer-Encoding: base64
                  Content-Disposition: inline
                  
                  [base64 image data here]
                  
                  --a1b2c3d4e3f2g1--
                  

                  非常感谢.

                  顺便说一句:是的,我已经验证 base64 数据是正确的,因为我可以将图像嵌入 html 本身(使用相同的算法用于创建标题数据)并在 Firefox/IE 中查看图像.

                  BTW: Yes, I have verified that the base64 data is correct, as I can embed the image in the html itself (using same algo use for creating header data) and see image in Firefox/IE.

                  我还应该注意,这不是垃圾邮件,电子邮件会发送给每天都在等待的特定客户.内容是数据驱动的,而不是广告.

                  I should also note that this is NOT for spam, the emails are sent to specific clients who are expecting it daily. The content is data-driven, and not adverts.

                  推荐答案

                  尝试直接插入,这样你就可以在邮件的不同位置插入多张图片.

                  Try to insert it directly, this way you can insert multiple images at various locations in the email.

                  <img src="data:image/jpg;base64,{{base64-data-string here}}" />
                  

                  并使这篇文章对其他人有用:如果您没有 base64 数据字符串,请在以下位置轻松创建:http://www.motobit.com/util/base64-decoder-encoder.asp 来自图像文件.

                  And to make this post usefully for others to: If you don't have a base64-data string, create one easily at: http://www.motobit.com/util/base64-decoder-encoder.asp from a image file.

                  电子邮件源代码看起来像这样,但我真的不能告诉你那个边界是什么:

                  Email source code looks something like this, but i really cant tell you what that boundary thing is for:

                   To: email@email.de
                   Subject: ...
                   Content-Type: multipart/related;
                   boundary="------------090303020209010600070908"
                  
                  This is a multi-part message in MIME format.
                  --------------090303020209010600070908
                  Content-Type: text/html; charset=ISO-8859-15
                  Content-Transfer-Encoding: 7bit
                  
                  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
                  <html>
                    <head>
                  
                      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
                    </head>
                    <body bgcolor="#ffffff" text="#000000">
                      <img src="cid:part1.06090408.01060107" alt="">
                    </body>
                  </html>
                  
                  --------------090303020209010600070908
                  Content-Type: image/png;
                   name="moz-screenshot.png"
                  Content-Transfer-Encoding: base64
                  Content-ID: <part1.06090408.01060107>
                  Content-Disposition: inline;
                   filename="moz-screenshot.png"
                  
                  [base64 image data here]
                  
                  --------------090303020209010600070908--
                  

                  //哦,我刚刚意识到,如果您插入我帖子中的第一个代码片段以使用 Thunderbird 编写电子邮件,Thunderbird 会自动将 html 代码更改为与我帖子中的第二个代码几乎相同.

                  // Oh, i just realize if you insert the first code snippet from my post to write an email with thunderbird, thunderbird automatically changes the html code to look pretty much the same as the second code in my post.

                  这篇关于在 html 电子邮件中嵌入图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:除了 1 或 2 个字段之外,您可以选择所有内容而不会出现作家抽筋吗? 下一篇:如何在 Oracle 数据库中创建临时表?

                  相关文章

                  <small id='URG6x'></small><noframes id='URG6x'>

                  1. <tfoot id='URG6x'></tfoot>
                    <legend id='URG6x'><style id='URG6x'><dir id='URG6x'><q id='URG6x'></q></dir></style></legend>

                  2. <i id='URG6x'><tr id='URG6x'><dt id='URG6x'><q id='URG6x'><span id='URG6x'><b id='URG6x'><form id='URG6x'><ins id='URG6x'></ins><ul id='URG6x'></ul><sub id='URG6x'></sub></form><legend id='URG6x'></legend><bdo id='URG6x'><pre id='URG6x'><center id='URG6x'></center></pre></bdo></b><th id='URG6x'></th></span></q></dt></tr></i><div id='URG6x'><tfoot id='URG6x'></tfoot><dl id='URG6x'><fieldset id='URG6x'></fieldset></dl></div>
                      <bdo id='URG6x'></bdo><ul id='URG6x'></ul>