Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

system.web.mail.mailattachment with database stored attachments

Posted on 2004-04-25
13
Medium Priority
?
461 Views
Last Modified: 2012-05-04
Hi all

Is there anyway that I can add an attachment to my mail from the database stored representation of an attachment (storing doc name, mime type and text stream) without first storing it to disk?

Are URLs acceptable parameters to mailattachment?  Is there another way, which does't involve a url call?

Thanks
Ben
0
Comment
Question by:bjohns33
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 2
  • +1
13 Comments
 
LVL 10

Accepted Solution

by:
ptmcomp earned 2000 total points
ID: 10911634
Doesn't seem to be possible. There is neither a base class, a protected method nor an interface :o(.
0
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 10912538
0
 
LVL 1

Author Comment

by:bjohns33
ID: 10912838
Hi ptm, thanks for the response - even though slightly depressing ;-)

Rama

The link listed unfortunately uses the write to disk approach, which is what I'd ideally like to avoid.

Cheers
Ben
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 10

Expert Comment

by:ptmcomp
ID: 10912982
What do you mean by being depressing? It contains the XSL and the whole source code.
0
 
LVL 1

Author Comment

by:bjohns33
ID: 10913037
"Doesn't seem to be possible. There is neither a base class, a protected method nor an interface :o(."?

Thought that was quite depressing, lol.  Are you in another thread at the same time?

0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 10913271
Oops mixed up two threads - should only do one thing at one time. I'm not multitasking compliant...
0
 
LVL 1

Author Comment

by:bjohns33
ID: 10913301
lol, was getting worried if i needed XSL for this.
0
 
LVL 10

Expert Comment

by:eternal_21
ID: 10913440
Haha, I was going through RK's link looking for XSL.

Anyway, bjohns33, you can do what you would like using CDONTS, or a 3rd Party Mail component.  I was looking for an example for you for CDO, but I have not found one yet (although I *have* seen them).  I will keep looking, but just to get you headed in some direction...
0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 10913486
[I think I opened more than one Email and thought I clicked on the other thread's link.]
Yes, eternal_21 is right it can be done by a different mail component. CDO could be one. You could also use one of many freeware components. Else just create a temporary file on disk even it's not that clean.
0
 
LVL 1

Author Comment

by:bjohns33
ID: 10913512
Yes, might have to bite the bullet and go for the temporary file - you know how it is, always want to make it as elegant as possible!  I think CDO is probably going to open up a whole world of pain, and this is part of a solution that may be sold in the future, so freeware licensing is going to be a problem.

Thanks both for your help - not sure where the points go though!
0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 10913771
How do you want to continue? Mailcomponent, CDO or file?
0
 
LVL 10

Expert Comment

by:eternal_21
ID: 10915067
Send the points ptmcomp's way.  He did answer your question exactly, and was 100% correct: You cannot send an attachment using System.Web.Mail without storing it in the file system.
0
 
LVL 1

Author Comment

by:bjohns33
ID: 10915788
Fair point eternal.  I think I'm going to go file system.  Thanks for the discussion - shame it isn't possible without add-ins.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question