图片不会出现在电子邮件中 [英] Images don't appear in emails

查看:119
本文介绍了图片不会出现在电子邮件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的MVC应用程序的 App_Data 文件夹中有一个HTML电子邮件模板。在我的代码中,我使用此模板向用户发送HTML电子邮件。此模板引用我项目中的一个文件夹中的几个图像。问题是,当用户收到电子邮件时,这些图像根本就不会出现。我试图使用〜/ path 将图像引用到 image / image.gif 。我已经尝试使用 ../../路径到image / image.gif ,我已经将图像复制到 App_Data 文件夹,只是引用图像,因此 image.gif 。没有任何工作。有没有人有什么建议?

I have a HTML email template in the App_Data folder of my MVC application. In my code, I use this template to send HTML emails to users. This template references a few images in a folder in my project. The issue is that these images don't appear at all when the user receives the email. I have tried to reference the images using ~/path to image/image.gif. I have tried using ../../path to image/image.gif and I have copied the images to the App_Data folder and just referenced the images thus image.gif. Nothing is working. Does anyone have any suggestions?

推荐答案

图像需要存储在可公开访问的位置,完整参考图像 < img src =http://my.domain.com/images/filename.ext/> 或图片需要嵌入电子邮件中。

the images either need to be stored in a publicly accessible location with a full reference to the image <img src="http://my.domain.com/images/filename.ext" /> or the images need to be embedded into the email.

这篇关于图片不会出现在电子邮件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆