Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JMAIL component - saving an email to disk including attachments

Status
Not open for further replies.

flbos

Programmer
Sep 15, 2005
41
NL
Hello,
I'm using the Jmail component to create and send emails. The application is only used for sending emails, receiving is not an issue. What I currently do is using a GUI that enables the user to create and send emails, the underlying component I use is the Jmail component. This all works fine but I've got one problem.

I need to save the outgoing messages. I currently do this by saving the header, body and the 'from address' in a mysql database. This works fine of course but now I also want the users to be able to add attachments. The main problem now is that I want the users to be able to save the outgoing message including the attachments. Of course I can save the attachments in the running directory of the application and create a diffrerent subdir for each message (based on a message id number), then each subdir would contain the attachments for a particular message.

However before I begin programming such a system I want to be sure that this can't be done much easier. Therefore my question is whether there is a build in system (in the jmail component maybe) that allows me to save the whole email (header, body, from address AND ATTACHMENTS) on disk (to a single file ?). I would like to be able to save the email, load it at any time and then be able to substract the different parts of the email (header, body, from address AND ATTACHMENTS) to show them in my GUI again.

Can someone advice me on what the best solution would be?
 
Must be someone who has a clue isn't there? I've tried additional searching on the internet but still didn't find the solution...
 
I actually do what you are suggesting.

The only other way i've seen is... outlook's Dat file. This is great for proprietary systems but, and for keeping all the info in one file rather than a huge folder structure...
It will keep your users stuck to your system :) But then you'd have to figure out how to create such a file

My customers are going to be using HTML formated email, so there's a lot of images and references to attachments in the email itself.

Mark P.
Providing Low Cost Powerful Point of Sale Solutions.
 
Another option (although it is not an 'easier' one) would be to add a table to your database that contains a 'Blob' field and an identifier to link it back to the email table. You can use that table to store the attachments in the database.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Thanks, but markphsd, how do I thus create a Outlook dat file? Do you have a working example?

My users will use html mail as well as flat text mail, so I need to cover both these options. Image attachments as well as 'normal' attachments will also be used
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top