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

问题描述

如何在发送给Hotmail用户的邮件中嵌入图像?
我尝试过此操作(如下),它对Yahoo用户非常有效.
如何为Hotmail用户使用它?

How can I embed Images on messages to Hotmail users ?
I tried this one (below) and it works well for Yahoo users.
How can I do it works for Hotmail users ?

MailMessage MsgTorp = new MailMessage(pOrigem, pDestino, pTitulo, pTexto);
ContentType mimeType = new System.Net.Mime.ContentType("text/html");
AlternateView alternate = AlternateView.CreateAlternateViewFromString(MsgTexto, mimeType);

LinkedResource FotoUser = new LinkedResource(pFoto);
FotoUser.ContentId = "FotoUserTorpedo";
FotoUser.TransferEncoding = TransferEncoding.Base64;
alternate.LinkedResources.Add( FotoUser );

Attachment attach = new Attachment(pFoto);
MsgTorp.Attachments.Add(attach);

MsgTorp.IsBodyHtml = true;
MsgTorp.AlternateViews.Add(alternate);

SmtpClient SmtpCliente = new SmtpClient(); //pServer);
SmtpCliente.Send(MsgTorp);



谢谢,

Guilherme



Thanks,

Guilherme

推荐答案



这篇关于邮件到Hotmail上的嵌入式图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 01:21