HTML中的图像 [英] Images in HTML

查看:46
本文介绍了HTML中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有很少的邮件模板(.html)我们用
来发送邮件。


我们想要一些Logo那就是...当我发送邮件给用户时,


图像应该像邮件中一样嵌入式嵌入


图像。我无法得到这个。我尝试了


Message.Attachments.add ...但它发送图像


作为附件。请注意我不想给那些网站提供任何网站的网址


图片因为我们会向一些没有发送邮件的用户发送邮件


有互联网接入。他们应该能够看到图像离线。


我通过网络搜索...并且知道我必须使用PAID第三个


派对工具。我无法相信这一点。


因为我9年的经历我从来没有遇到过这样的情况:我b $ b无法实现某些目标微软。


我是否必须使用Cid(ContentId)?如果是..请告诉我我如何生成这个Cid?


请告诉我如何发送HTML邮件-line

C#和ASP.Net

We have few Mail templates (.html) which we

use to send mails.

We want to have some Logo in that ie ... when I send the mail to user the

image should go as in-line embedded

image in mail. I am not able to get this. I tried with

Message.Attachments.add ... but its sending the image

as an attachment. Please note I do not want to give any website URL to those

images coz we would be sending mails

to some users who do not have Internet Access. They should be able to see

the Images Offline.

I searched over the net ... and got to know that I have to use PAID third

party tools. I can not believe this.

coz in my 9 yrs experience I have never come across a situation where I

could not achieve something with Microsoft.

Do I have to use Cid (ContentId) ? If YES .. kindly let me know how do I

generate this Cid ?

Kindly let me know how to send HTML mails with in-line embedded images using

C# and ASP.Net

推荐答案




这应该只是将你的src属性设置为图像

名称并将每个图像附加到邮件上。


这对我有用:


//将用户代码设置为初始化页面\

MailMessage mail = new MailMessage();

mail.To =" te ** @ test.net";

SmtpMail.SmtpServer =" localhost";

mail.From =&te; te **@test.net" ;;

mail.Attachments.Add(new MailAttachment(" c:\\ temp \\progressbar.gif"));

mail.BodyFormat = System.Web.Mail.MailFormat.Html;

mail.Body ="< html>< body> test< img src =''progressbar.gif' />< /体>< ; / html>" ;;

SmtpMail.Send(mail);

希望这会有所帮助....

T.Michelle写道:
Hi,

This should just be a matter of setting your src attributes to the image
name and attaching each image to the mail.

This works for me:

// Put user code to initialize the page here\
MailMessage mail = new MailMessage();
mail.To="te**@test.net";
SmtpMail.SmtpServer="localhost";
mail.From="te**@test.net";
mail.Attachments.Add(new MailAttachment("c:\\temp\\progressbar.gif"));
mail.BodyFormat=System.Web.Mail.MailFormat.Html;
mail.Body="<html><body>test<img src=''progressbar.gif''/></body></html>";
SmtpMail.Send(mail);
Hope this helps....
T.Michelle wrote:
我们有很少的邮件模板(.html),我们用它来发送邮件。

我们想要一些Logo在那个... ...当我发送邮件给用户时,

图像应该像邮件中的内嵌嵌入式图像一样。我无法得到这个。我尝试了使用

Message.Attachments.add ...但它发送图像

作为附件。请注意我不想给那些图像提供任何网站URL,因为我们会向没有Internet访问权限的用户发送邮件

。他们应该能够看到离线图像。

我在网上搜索了......并且知道我必须使用PAID第三个
<派对工具。我无法相信这一点。

在我9年的经历中,我从来没有遇到过这样的情况:我无法与微软取得成果。

请告诉我如何使用

C#和ASP.Net
We have few Mail templates (.html) which we

use to send mails.

We want to have some Logo in that ie ... when I send the mail to user the

image should go as in-line embedded

image in mail. I am not able to get this. I tried with

Message.Attachments.add ... but its sending the image

as an attachment. Please note I do not want to give any website URL to those

images coz we would be sending mails

to some users who do not have Internet Access. They should be able to see

the Images Offline.

I searched over the net ... and got to know that I have to use PAID third

party tools. I can not believe this.

coz in my 9 yrs experience I have never come across a situation where I

could not achieve something with Microsoft.

Do I have to use Cid (ContentId) ? If YES .. kindly let me know how do I

generate this Cid ?

Kindly let me know how to send HTML mails with in-line embedded images using

C# and ASP.Net



没有它没有帮助,要做到这一点你必须发送e - 邮件为MIME格式,

mutlipart /相关内容类型。 MailMessage不支持这个,你需要

来编写自己的类(或找到一个)。


Jerry


" Ruprict" < RU ***** @ bellsouth.net>在消息中写道

新闻:Hl ******************* @ bignews1.bellsouth.net。 ..
No it won''t help, to do that you have to send the e-mail as MIME formatted,
mutlipart/related content type. MailMessage doesn''t support this, you need
to write your own class (or find one) that does.

Jerry

"Ruprict" <ru*****@bellsouth.net> wrote in message
news:Hl*******************@bignews1.bellsouth.net. ..


这应该只是将src属性设置为图像名称并将每个图像附加到邮件中。

这对我有用:

//用户代码在这里初始化页面\
MailMessage mail = new MailMessage();
mail.To = te ** @ test.net;
SmtpMail.SmtpServer =" localhost" ;;
mail.From =&te; te ** @ test.net" ;;
mail.Attachments .Add(new MailAttachment(" c:\\ temp\\progressbar.gif"));
mail.BodyFormat = System.Web.Mail.MailFormat.Html;
mail。 Body ="< html>< body> test< img src =''progressbar.gif''/>< / body>< / html>" ;;
SmtpMail.Send(mail) ;

希望这有帮助....

T.Michelle写道:
Hi,

This should just be a matter of setting your src attributes to the image
name and attaching each image to the mail.

This works for me:

// Put user code to initialize the page here\
MailMessage mail = new MailMessage();
mail.To="te**@test.net";
SmtpMail.SmtpServer="localhost";
mail.From="te**@test.net";
mail.Attachments.Add(new MailAttachment("c:\\temp\\progressbar.gif"));
mail.BodyFormat=System.Web.Mail.MailFormat.Html;
mail.Body="<html><body>test<img src=''progressbar.gif''/></body></html>";
SmtpMail.Send(mail);
Hope this helps....
T.Michelle wrote:
我们有很少的邮件模板(.html)我们用它来发送邮件。

我们希望在那里有一些Logo ...当我发送邮件给用户

图像应该像邮件中的内嵌嵌入式图像一样。我无法得到这个。我尝试了使用

Message.Attachments.add ...但它发送图像

作为附件。请注意我不想将任何网站URL提供给
那些
图像因为我们将向没有Internet访问权限的用户发送邮件

。他们应该能够
看到图像离线。

我在网上搜索...并且知道我必须使用PAID
third <派对工具。我无法相信这一点。

在我9年的经历中,我从来没有遇到过这样的情况:我无法与微软取得成果。

请告诉我如何使用嵌入式嵌入式图像发送HTML邮件
使用
C#和ASP.Net
We have few Mail templates (.html) which we

use to send mails.

We want to have some Logo in that ie ... when I send the mail to user the
image should go as in-line embedded

image in mail. I am not able to get this. I tried with

Message.Attachments.add ... but its sending the image

as an attachment. Please note I do not want to give any website URL to those
images coz we would be sending mails

to some users who do not have Internet Access. They should be able to see
the Images Offline.

I searched over the net ... and got to know that I have to use PAID third
party tools. I can not believe this.

coz in my 9 yrs experience I have never come across a situation where I

could not achieve something with Microsoft.

Do I have to use Cid (ContentId) ? If YES .. kindly let me know how do I

generate this Cid ?

Kindly let me know how to send HTML mails with in-line embedded images using
C# and ASP.Net



" Jerry III" < JE ****** @ hotmail.com>在新闻中写道:eXr1fP44DHA.2576

@ TK2MSFTNGP11.phx.gbl:
"Jerry III" <je******@hotmail.com> wrote in news:eXr1fP44DHA.2576
@TK2MSFTNGP11.phx.gbl:
不,它没有帮助,要做到这一点,你必须发送电子邮件作为MIME
mutlipart /相关内容类型。 MailMessage不支持这个,你编写自己的类(或找到一个)。
No it won''t help, to do that you have to send the e-mail as MIME
mutlipart/related content type. MailMessage doesn''t support this, you
to write your own class (or find one) that does.



http://www.indyproject.org/indy.html


完全支持MIME还有更多信息。它完全免费。 :)


如果你需要帮助为Indy编写示例代码,你可以在这里或在

的Indy新闻组中询问。



http://www.indyproject.org/indy.html

Fully supports MIME and more in messages. Its absolutely free too. :)

If you need help with writing sample code for Indy, you can ask here or in
the Indy newsgroups.

>我在网上搜索了......并且知道我必须使用PAID第三个>
>派对工具。我无法相信这。


第三方,但未付款。 :)

>因为在我9年的经历中,我从来没有遇到过我的情况
>无法与微软实现目标。
> I searched over the net ... and got to know that I have to use PAID third >
> party tools. I can not believe this.
Third party, but not paid. :)
> coz in my 9 yrs experience I have never come across a situation where I
> could not achieve something with Microsoft.




我不确定你在做什么,但它对我来说是一种日常体验。 :)

-

Chad Z. Hower(又名Kudzu) - http://www.hower.org/Kudzu/

编程是一种反击的艺术形式

ELKNews - 在 http://www.atozedsoftware.com 上获取免费副本



Im not sure what you''ve been doing, but its a daily experience for me. :)
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
ELKNews - Get your free copy at http://www.atozedsoftware.com


这篇关于HTML中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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