Can we send mail with different attachments of different mail ids by one java code..

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Can we send mail with different attachments of different mail ids by one java code..

Can we send mail with different attachments for different mail ids by one java code in one click while changing the dates...
+++++++++++++++++++++++++++++++++++++++++++++++
There are three Different directory's from where attachment should be picked..

for example

Say in dir 1==& the file name is ID0229_1.zip is supposed to go to the mail id xyz@xyz.com..
dir ==1 file name ID0329_1.zip upto id6329_1.zip.

let me explain it to you .
There are three different directories in which we have 61 zipped files.
say the zip file ID0201_1.zip is supposed to do to the email id 02@aa.com,& similarly with the all 60files & from all three directories..

Your explanation is still lacking. What exactly are you trying to do? Why are there 60 files? Who gets each one? What does the file name format (which you've explained twice) have to do with the problem?

What code do you already have written? Show us where you are by posting the code (in code tags), and specific questions about it. Also post full error/exception messages you have received (also in code tags).

If you want our help, you have to help us. You understand the domain and the problem, we do not. Until we do, we can't be of any real help to you.

That being said, if I understand what you want to do (which is doubtful), you probably want to take in the mail to address, check who it is, then attach the appropriate file based on the name contained in the address. This would be as easily done as a set of if statements or a hash table for lookup. You would look up the base name and add the date to the file name based on whatever criteria you have for date selection (current day, last week, etc.) Make sure you read the names and the files they need from a properties file so you don't have to rebuild the code every time this association changes.

Last edited by ajhampson; 06-23-2010 at 11:50 AM.
Reason: clarification

let me tell you that I'm have my company's data(Database file) in that file which contains the information about the clients of our company & all the records related to the client's are stored in that file.now we have 60 different offices at different locations & have email id for each.The data will be sent from my office called as HUB to my branch offices..

For each directory
{
Open the directory
Get the list of files
For each file
{
Parse the file name for the office id
Create an email to that office id with the filename as a subject
Attach the file and send the email
}
}

then is the main directory with the the option to access each directory
{
Open the directory
Get the list of files
For each file
{
Parse the file name for the office id
Create an email to that office id with the filename & directory name as a subject
Attach the file and send the email & with one send click all attachments goes to mailbox.
}
}

then is the main directory with the the option to access each directory
{
Open the directory
Get the list of files
For each file
{
Parse the file name for the office id
Create an email to that office id with the filename & directory name as a subject
Attach the file and send the email & with one send click all attachments goes to mailbox.
}
}

I think this can help you little bit.

Nope, no help really.

I don't know what you mean by "Date come first." Do you mean you would first select the date for the data files? Do you have a folder for each day? Then does the day folder have 3 sub folders in it? What is the purpose of the sub folders?

Please remember to use code tags around code and structured algorithms to preserve formatting.

Well If i could have Write this code there was no chance to request you to write this.

Ahhhh. I didn't realize that was what you were doing. Well the fundamental problem is that we don't write code for people here. We're happy to help you define your problem and answer coding questions.

I (like most of the forum members) get paid to do a full-time job and don't really have time to write your entire project for free. You should check out some of the sites where you can get developers to bid on writing code for you.