File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes Mail API content type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Mail API content type" Watch "Mail API content type" New topic
Author

Mail API content type

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 758
Hello



in the code above i'm passing array list as an arg to my function below



but i'm not able to send arrat list as a message body.the actual thing i want to pass is hash map it self...HOW DO I PASS HASH MAP OR ARRAY LIST AS AN ARGUEMENT ???

ANY IDEA ???


Jigar Naik


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61589
    
  67

Moved to Other Java APIs where JavaMail is discussed.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8963
    
    9

Please KeepItDown.
There's no mime type for representing array lists or hash maps. You need to render the data you are sending as some sort of document so the mail reader on the receiving end can make sense of it.


[How To Ask Questions On JavaRanch]
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 758
sorry for caps letter... i did not mean it what you thought...

there is no mime type for passing hash map or array list to messagebodypart...

atlast i had to pass string as an arguement...

what i did is picked every key value pair of hash map and concat it to a String message;

but i feel it's not a good solution.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18860
    
    8

Another solution would be to serialize your data to a byte array, then attach that as if it were a file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mail API content type