• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mail API content type

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ???
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to Other Java APIs where JavaMail is discussed.
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another solution would be to serialize your data to a byte array, then attach that as if it were a file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic