473,725 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mail attachment from memory

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
Apr 13 '06 #1
9 1584

What does that mean?
"Goran Djuranovic" <go************ **@newsgroups.n ospam> wrote in message news:e5******** ******@TK2MSFTN GP02.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.
Apr 13 '06 #2
http://www.example-code.com/vbdotnet...ttachments.asp

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

"Goran Djuranovic" <go************ **@newsgroups.n ospam> wrote in message
news:e5******** ******@TK2MSFTN GP02.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
Apr 13 '06 #3
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.)


Apr 13 '06 #4
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

"vbnetdev" <vb******@commu nity.nospam> wrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
http://www.example-code.com/vbdotnet...ttachments.asp

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

"Goran Djuranovic" <go************ **@newsgroups.n ospam> wrote in message
news:e5******** ******@TK2MSFTN GP02.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

Apr 13 '06 #5
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

"Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
news:jT******** ******@TK2MSFTN GXA01.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.)

Apr 13 '06 #6
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" <no****@nowhere .com> wrote in message news:7yi%f.7246 3$%H.64161@clgr ps13...

What does that mean?
"Goran Djuranovic" <go************ **@newsgroups.n ospam> wrote in message news:e5******** ******@TK2MSFTN GP02.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.
Apr 13 '06 #7
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.)
Apr 14 '06 #8
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
Apr 18 '06 #9
Thanks body. You are a savior. :-)))

- G.D.

"Andrew Morton" <ak*@in-press.co.uk.inv alid> wrote in message
news:uX******** ******@TK2MSFTN GP02.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

Apr 18 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3273
by: PeterR | last post by:
I've spent weeks trying to write a function that is simple to use for sending emails with attachments, but I my programming skills are not that advanced. I've noticed a few postings in these newsgroups with the same problem, so I just want to share my solution. I recommend using libmail from http://lwest.free.fr/doc/php/lib/index.php3?page=mail&lang=en it has made my university project much simplier now! :-)
2
3187
by: knoak | last post by:
Hi there, I've found a script at these great Google fora. a script to send emails with attachments. The script is below this message, name etc. aren't mine, but from the original post. My questions are: - Is this script extra heavy for a server, or should it be no problem?
0
377
by: imre.adam | last post by:
The original message was received at Wed, 2 Mar 2005 20:06:59 +0100 from 87.26.243.56 ----- The following addresses had permanent fatal errors ----- <python-list@python.org> ----- Transcript of session follows ----- .... while talking to python.org.: 554 Service unavailable; blocked using relays.osirusoft.com Session aborted, reason: lost connection
1
5905
by: theWizard1 | last post by:
The following sends my email, but the attachment is empty. The attachment should contain the data that is in the string that was created from the xmlReader. I have a stored procedure written using For XML explicit, and it returns an xml reader. Then the following: xmlRdr.MoveToContent(); string myTemp = xmlRdr.ReadOuterXml();
0
3775
by: bambi | last post by:
I am facing issues while adding attachments in an E-mail via Mapisend. The code I use is below. If I try to send , I am getting error messgae in Mailmessage.12. Mailmessage.12 is expected as numeric, I do not know what should it be. If I Provide '0', it is throwing out error. Can any one help what shoudl I do to fix this. I am able to send E-mail sucessfully without Attachments.. Code (Please refer comments near Mailmessage.12) OPTIONS...
1
2441
by: William Connery | last post by:
Hi, I have a small python program with e-mail capabilities that I have pieced together from code snippets found on the internet. The program uses the smtplib module to successfully send an e-mail with an attachment. I want to give users an indication of the percentage of the e-mail that has already been sent so as to avoid frustration when dealing with large attachments or a slow smtp server. But the smtplib module doesn't seem to...
2
566
by: eng.sharif | last post by:
hi group how i can send mail and attachement in php with "mail function " $s = mail($to,$subject,$cont, $headers); can anyone help
2
2672
by: Ruud | last post by:
Just before leaving for a holiday my collegue modified this script. Now it won't send any body text (The data filled in on the form) and in an error condition it won't send any attachments either. Because I don't understand PHP I cannot find the error. Who is willing to help? regards Ruud
1
6856
by: maxxxxel | last post by:
Hi Can anyone help me with some asp code , I changed the code to use CDO.message instead of the old cdont.sys to send mail from a ASP webpage which works fine. Our problem is that when we send mail externally to a internet email site like Gmail the PDF is sent but is corrupted because CDOSYS ends up using binary encoding rather than Base64 encoding when creating the attachment. More information here: Anthonys Code My knowledge of ASP...
0
8888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.