开发者

C# SMTPClient sending attachment which locates in a url

In C#,How can i add an attachment which locates in a remote url(Ex:http://www.mydomain.com/attahments/sample.p开发者_开发知识库df) ?

I dont see that kind of overload for Attachment class constructor.

Any thoughts ?


You could download the file to your local system using one of the Download* methods of the System.Net.WebClient class, and then attach it to your mail message.

I don't know how to attach the response stream of the webclient to the mailmessage attachment directly without saving the file to disk. Should be possible, although not according to this resource.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜