简体   繁体   English

如何在我的网页中显示Gmail插入的图像

[英]How to show gmail inserted images in my webpage

I am using mailgun. 我正在使用邮枪。 now i am sending mail from gmail to my domain. 现在我正在从gmail发送邮件到我的域。 using mailgun api i am getting that and showing that content in my webpage. 使用mailgun api,我正在获取并在我的网页中显示该内容。 but when i am adding images in middle of the text or in signature of the mail image is not showing in webpage. 但是当我在文本中间或邮件签名中添加图像时,网页中没有显示图像。 it is just showing broken image because it is showing like this: 它只是显示损坏的图像,因为它显示如下:

<img width="375" height="134" src="cid:ii_i2davb0f0_1499f1c3646e87a5">

How can i show these images in web page? 如何在网页中显示这些图像?

I don't know how you create the body of your email, but it has to contain as a src a link to your server stored image like this: 我不知道您如何创建电子邮件的正文,但它必须包含指向服务器存储图像的src链接,如下所示:

(replace with this line in the file that creates the body of your email) (在创建电子邮件正文的文件中用此行替换)
<img width="375" height="134" src="http://yourdomain.com/path/to/image.format">

and when you will have it in your email, it will get the image from your server. 当您将其包含在电子邮件中时,它将从您的服务器获取图像。

Hope this helps! 希望这可以帮助! :D :D

The part after the cid: is the unique identifier for the attachment that has that image. cid:之后的部分是具有该图像的附件的唯一标识符。 You will need to check the attachment headers, and match the one for that image, and likely de-base64/uudencode the image back to binary, store on your server, and show it using normal means. 您将需要检查附件标头,并将其与该映像的标头匹配,并可能将映像进行debase64 / uudencode编码回二进制文件,存储在服务器上,并使用常规方式显示。

Looking at their docs here, http://documentation.mailgun.com/user_manual.html#routes 在此处查看其文档, http://documentation.mailgun.com/user_manual.html#routes

There will be an attachment-x part of the returned message array, that there is one for each attachment. 返回的消息数组将包含一个attachment-x部分,每个附件都有一个。 You will just have to check which one matches your identifier 您只需要检查哪一个与您的标识符匹配

My bad: they will be in the content-id-map section. 我的错:它们将在content-id-map部分中。 Check the "Parsed Messages Parameters" section of the routes link above 检查上方路由链接的“已解析消息参数”部分

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM