无法将类型为“System.Net.Mail.AttachmentCollection”的对象强制转换为“System.Web.Mail.MailAttachment”。 [英] Unable to cast object of type 'System.Net.Mail.AttachmentCollection' to type 'System.Web.Mail.MailAttachment'.

查看:139
本文介绍了无法将类型为“System.Net.Mail.AttachmentCollection”的对象强制转换为“System.Web.Mail.MailAttachment”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai All,



发送邮件时,我收到一个像这样的错误Unable将'System.Net.Mail.AttachmentCollection'类型的对象转换为'System.Web.Mail.MailAttachment'类型。

任何人都可以解决dis ... ...请帮助我




Thnks Advnc

Aatif Ali Bangalore

Hai All,

while sending mail,i got one error like this Unable to cast object of type 'System.Net.Mail.AttachmentCollection' to type 'System.Web.Mail.MailAttachment'.
anyone can solve dis one...? pls help me


Thnks Advnc
Aatif Ali Bangalore

推荐答案

尝试:

Try:
webmessage.Attachments.AddRange(message.Attachments);


这篇关于无法将类型为“System.Net.Mail.AttachmentCollection”的对象强制转换为“System.Web.Mail.MailAttachment”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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