Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Bakup mail

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all!
I have created a mail folder named "Bakup" on my mail server with java mail API.When I send mail to someone,I want to bakup it.I don't know how to start,can you help me?
Thank you very much!!
------------------
Java lover from hell!
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Solution : When you are creating the message and right before you are about to transport it you can write the message to a text file e.g. in your case call it backup.txt Use this code :
message.writeTo( new FileOutputStream("backup.txt") );

 
Metal Zhang
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx for your reply.Your advice is very good!

Originally posted by rohan baweja:
Solution : When you are creating the message and right before you are about to transport it you can write the message to a text file e.g. in your case call it backup.txt Use this code :
message.writeTo( new FileOutputStream("backup.txt") );


------------------
Java lover from hell!
[This message has been edited by Metal Zhang (edited August 19, 2001).]
 
Rohan Baweja
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are welcome Metal Zhang. I was also facing the same problem till about a week back and I bumped into this question in some other forum.
Actually I have a problem which is an extension to Metal's problem. My question is : Can Mail Messages recieved from a pop mailbox be stored as an ARRAY of messages in a single file on the local machine? If the answer is yes, I would be grateful if you could tell me.
And also how can those messages be read as an array later from the backup file.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic