Home All Groups Group Topic Archive Search About

Mail attachment from memory

Author
12 Apr 2006 11:22 PM
Goran Djuranovic
Hi all,
Does anyone know how to send mail with attachment from memory, rather than from a file on disk? I am using VB.NET 2003.

Thanks in advance
Goran Djuranovic

Author
13 Apr 2006 2:18 AM
Homer J Simpson
What does that mean?
  "Goran Djuranovic" <goran.djuranovic@newsgroups.nospam> wrote in message news:e5F9qfoXGHA.4212@TK2MSFTNGP02.phx.gbl...
  Hi all,
  Does anyone know how to send mail with attachment from memory, rather than from a file on disk? I am using VB.NET 2003.
Author
13 Apr 2006 2:04 PM
Goran Djuranovic
Hi Homer,
I am trying to attach HTML (or any other) document without having to save it to the disk. It get the "Specified cast is not valid." error on ".Send(MailObj)" line.
I guess I could format the Mail object to be HTML, bad I would really like to send HTML doc.

Thanks
Goran Djuranovic


  "Homer J Simpson" <nob***@nowhere.com> wrote in message news:7yi%f.72463$%H.64161@clgrps13...

  What does that mean?
    "Goran Djuranovic" <goran.djuranovic@newsgroups.nospam> wrote in message news:e5F9qfoXGHA.4212@TK2MSFTNGP02.phx.gbl...
    Hi all,
    Does anyone know how to send mail with attachment from memory, rather than from a file on disk? I am using VB.NET 2003.
Author
13 Apr 2006 2:30 AM
vbnetdev
http://www.example-code.com/vbdotnet/InMemoryAttachments.asp

--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com



"Goran Djuranovic" <goran.djuranovic@newsgroups.nospam> wrote in message
news:e5F9qfoXGHA.4212@TK2MSFTNGP02.phx.gbl...
Hi all,
Does anyone know how to send mail with attachment from memory, rather than
from a file on disk? I am using VB.NET 2003.

Thanks in advance
Goran Djuranovic
Author
13 Apr 2006 7:46 AM
Steven Cheng[MSFT]
Hi Goran,

As for .NET 1.1, the system.web.mail component only support file based
attachement, if you do need to send attachement from inmemory or other
source, we may need to consider using other 3rd party smtp component. For
.NET 2.0, the system.net.mail component can help generate attachment from
different source(include inmemoryt stream).

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Author
13 Apr 2006 2:01 PM
Goran Djuranovic
Hi Steve,
Thanks for your response. Too bad .NET v1.1 does not support that.
As for the problem specifics, I was trying to attach HTMLDocument without
having to save it to the disk, but got the "Specified cast is not valid."
error on ".Send(MailObj)" line.

Goran

Show quoteHide quote
"Steven Cheng[MSFT]" <stch***@online.microsoft.com> wrote in message
news:jT99j5sXGHA.5540@TK2MSFTNGXA01.phx.gbl...
> Hi Goran,
>
> As for .NET 1.1, the system.web.mail component only support file based
> attachement, if you do need to send attachement from inmemory or other
> source, we may need to consider using other 3rd party smtp component. For
> NET 2.0, the system.net.mail component can help generate attachment from
> different source(include inmemoryt stream).
>
> Regards,
>
> Steven Cheng
> Microsoft Online Community Support
>
>
> ==================================================
>
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
>
> ==================================================
>
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
>
>
Author
14 Apr 2006 2:19 AM
Steven Cheng[MSFT]
Thanks for the response Goran,

Yes, it is a bit awkward that the 1.1 System.Web.Mail component doesn't
provide such built-in funcitons and that's also why the 2.0 framework
include a pure new and powerful System.Net.Mail namespace. So far using 3rd
party component will be the available approach.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Author
13 Apr 2006 2:00 PM
Goran Djuranovic
Hi vbnetdev,
Thanks for your response. I was just trying to dodge the "3rd party"
solution. As for the problem, I was trying to attach HTMLDocument without
having to save it to the disk, but got the "Specified cast is not valid."
error on ".Send(MailObj)" line.

Goran

Show quoteHide quote
"vbnetdev" <vbnetdev@community.nospam> wrote in message
news:%23ln1EJqXGHA.3704@TK2MSFTNGP03.phx.gbl...
> http://www.example-code.com/vbdotnet/InMemoryAttachments.asp
>
> --
> Get a powerful web, database, application, and email hosting with KJM
> Solutions
> http://www.kjmsolutions.com
>
>
>
> "Goran Djuranovic" <goran.djuranovic@newsgroups.nospam> wrote in message
> news:e5F9qfoXGHA.4212@TK2MSFTNGP02.phx.gbl...
> Hi all,
> Does anyone know how to send mail with attachment from memory, rather than
> from a file on disk? I am using VB.NET 2003.
>
> Thanks in advance
> Goran Djuranovic
>
Author
18 Apr 2006 12:40 PM
Andrew Morton
Goran Djuranovic wrote:
> ... I was just trying to dodge the "3rd party"
> solution.

I've used the free http://www.aspemail.com/index.html in ASP; it comes with
a wrapper assembly for use in ASP.NET.

Andrew
Author
18 Apr 2006 6:12 PM
Goran Djuranovic
Thanks body. You are a savior. :-)))

- G.D.

Show quoteHide quote
"Andrew Morton" <a**@in-press.co.uk.invalid> wrote in message
news:uXoPBVuYGHA.3424@TK2MSFTNGP02.phx.gbl...
> Goran Djuranovic wrote:
>> ... I was just trying to dodge the "3rd party"
>> solution.
>
> I've used the free http://www.aspemail.com/index.html in ASP; it comes
> with a wrapper assembly for use in ASP.NET.
>
> Andrew
>