Mail attachment from memory

G

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
 
H

Homer J Simpson

What does that mean?
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.
 
S

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.)
 
G

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
 
G

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
 
G

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



What does that mean?
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.
 
S

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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top