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


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 14 of 14

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

Hybrid View

  1. #1
    Join Date
    Apr 2009
    Posts
    11

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

    ID0201_1.zip..was the file name..

    ID stands for the file name...

    02 stands for the Branch ..

    01 Stand for the current date..

    _1 Stands For the Directory where the data is stored.

    zip is the extension..
    Last edited by inmybluejens; 06-19-2010 at 09:48 AM.

  2. #2
    Join Date
    Apr 2009
    Posts
    11
    Still waiting for any reply..

  3. #3
    Join Date
    Jul 2005
    Location
    SW MO, USA
    Posts
    299
    I would say yes. If you can describe the problem you can probably write code to do it.

  4. #4
    Join Date
    Apr 2009
    Posts
    11
    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..

    ID stands for the file name...

    02 stands for the Branch name..

    01 Stand for the current date..

    _1 Stands For the Directory where the data is stored.

  5. #5
    Join Date
    May 2004
    Posts
    40
    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

  6. #6
    Join Date
    Apr 2009
    Posts
    11
    Well i have not written any code for this in java.

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

    i hope the this time i made you a little bit to understand.

  7. #7
    Join Date
    May 2004
    Posts
    40
    So, you want to
    Code:
    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
        }
    }
    Is this correct?

  8. #8
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Or do you need to simply put today's date as the first entry?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  9. #9
    Join Date
    Apr 2009
    Posts
    11
    Well It goes like this: first we have to select the date then we chose the main directory which contains the 3 Sub directories named as data1 data2 data3.

  10. #10
    Join Date
    May 2004
    Posts
    40
    Quote Originally Posted by inmybluejens View Post
    Well It goes like this: first we have to select the date then we chose the main directory which contains the 3 Sub directories named as data1 data2 data3.
    OK, so now you have a plan for the code and we've given you some hints as to what kind of code to write. You should try writing something and post back with your code and questions.

  11. #11
    Join Date
    Apr 2009
    Posts
    11
    Well If i could have Write this code there was no chance to request you to write this.

  12. #12
    Join Date
    May 2004
    Posts
    40
    Quote Originally Posted by inmybluejens View Post
    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.

    Good luck.

Similar Threads

  1. Writing Java code in Flash MX
    By Jeromy Payton in forum Web
    Replies: 2
    Last Post: 03-25-2006, 06:24 PM
  2. VS.Net and Code Behind
    By Chaitanya Marvici in forum ASP.NET
    Replies: 6
    Last Post: 07-21-2003, 10:15 AM
  3. gdb + native code + Java + linux
    By Jordan Dragoev Nedelchev in forum Java
    Replies: 0
    Last Post: 11-29-2002, 05:58 AM
  4. Replies: 1
    Last Post: 05-08-2002, 08:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center