Reputation: 218832
In C#,How can i add an attachment which locates in a remote url(Ex:http://www.mydomain.com/attahments/sample.pdf) ?
I dont see that kind of overload for Attachment class constructor.
Any thoughts ?
Upvotes: 1
Views: 1534
Reputation: 10557
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.
Upvotes: 1