Home All Groups Group Topic Archive Search About

ATTACHING A FILE USING A URL

Author
20 Nov 2007 6:27 PM
DRDragon
Hi,

I have an issue where I have to call a function that will return the url of
a file that I need to attach on an email before sending it.  I know 
System.Web.Mail does not support URL attachments.  If anyone has any ideas of
how this could be accomplished, I would appreciate the help.  It seems I
would have to get a local copy of the file that the url points to.  I have
seen 3'rd party email objects that would accomplish this,  but I would prefer
to not have to resort to them.  I am using VB.NET 2003.

Thanks,

David

Author
20 Nov 2007 8:49 PM
Spam Catcher
=?Utf-8?B?RFJEcmFnb24=?= <DRDra***@discussions.microsoft.com> wrote in
news:DEC19052-2B13-420F-A258-9907B9731848@microsoft.com:

> If anyone has any ideas of
> how this could be accomplished, I would appreciate the help.  It seems
> I would have to get a local copy of the file that the url points to.
> I have seen 3'rd party email objects that would accomplish this,  but
> I would prefer to not have to resort to them.  I am using VB.NET 2003.

Use WebClient or WebRequest to download the file from the server. Once
you've downloaded the file locally, it's very easy to attach the file to
your mail object.

What mail component are you you using?


--
Author
21 Nov 2007 4:12 PM
DRDragon
Hi Spam Carcher,

Thanks for the help, I was able to use Web Client to download the file.

I am using System.Web.Mail to send the emails out of an internal application.

DRDragon

Show quoteHide quote
"Spam Catcher" wrote:

> =?Utf-8?B?RFJEcmFnb24=?= <DRDra***@discussions.microsoft.com> wrote in
> news:DEC19052-2B13-420F-A258-9907B9731848@microsoft.com:
>
> > If anyone has any ideas of
> > how this could be accomplished, I would appreciate the help.  It seems
> > I would have to get a local copy of the file that the url points to.
> > I have seen 3'rd party email objects that would accomplish this,  but
> > I would prefer to not have to resort to them.  I am using VB.NET 2003.
>
> Use WebClient or WebRequest to download the file from the server. Once
> you've downloaded the file locally, it's very easy to attach the file to
> your mail object.
>
> What mail component are you you using?
>
>
>