Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
ashokbb_narra
Posts: 13
Registered: ‎02-26-2013
My Device: blackberry curve 8520

How to parse eml file in blackberry?

I am getting the data from server as eml forma like follows

 

Received: from AMAZONA-7KPH62I.xxxx.com ([fe80::39:4567:c6b1:24f0]) by
AMAZONA-7KPH62I.senditbank.com ([fe80::39:4567:c6b1:24f0%13]) with mapi id
14.01.0218.012; Tue, 19 Mar 2013 14:11:07 +0000
From: inno1 <inno1@xxxx.com>
To: "innofwd1@gmail.com" <innofwd1@gmail.com>
CC: "lgp96910@gmail.com" <lgp96910@gmail.com>
Subject: Mail with plain text option
Thread-Topic: Mail with plain text option
Thread-Index: Ac4kq5j8E8dx9845T9Wjhix+tt6rnA==
Date: Tue, 19 Mar 2013 14:11:06 +0000
Message-ID: <6C69800D57B13E4283041B296D7932A6F50C4F@AMAZONA-7KPH62I.senditbank.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 04
X-MS-Exchange-Organization-AuthSource: AMAZONA-7KPH62I.senditbank.com
X-MS-Has-Attach:
X-MS-Exchange-Organization-SCL: -1
X-MS-TNEF-Correlator:
x-ms-exchange-organization-originalsize: 3611
x-ms-exchange-organization-originalarrivaltime: 19 Mar 2013 14:11:06.5471
(UTC)
x-ms-exchange-organization-messagesource: StoreDriver
x-ms-exchange-organization-messagedirectionality: Originating
x-ms-exchange-forest-messagescope: 00000000-0000-0000-0000-000000000000
x-ms-exchange-organization-messagescope: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Organization-BCC:
x-ms-exchange-organization-originalclientipaddress: 202.153.33.226
x-originating-ip: [202.153.33.226]
x-ms-exchange-organization-originalserveripaddress: 10.12.83.210
x-ms-exchange-organization-messagelatency: SRV=AMAZONA-7KPH62I.senditbank.com:TOTAL=0
x-ms-exchange-organization-hygienepolicy: Standard
x-wiganss: 0100000001001EAMAZONA-7KPH62I.senditbank.com
ID0047<6C69800D57B13E4283041B296D7932A6F50C4F@AMAZONA-7KPH62I.senditbank.com>
x-ms-exchange-organization-recipient-limit-verified: True
x-ms-exchange-forest-rulesexecuted: AMAZONA-7KPH62I
x-ms-exchange-organization-rules-execution-history: SENDSetHeader
x-ms-exchange-organization-processed-by-journaling: Journal Agent
Content-Type: text/plain; charset="
"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Organization-ContentConversionOptions: False;00160000;True;;iso-8859-1
X-CA-SEND-ReplyPolicy: AllowUnencrypted
X-CA-SEND-ReplyAllPolicy: AllowUnencrypted
X-CA-SEND-ForwardPolicy: Deny

=0A=
Hi=0A=
=0A=
password=

 

How to parse the eml format in BB.any api's available?

 

 

 

Please use plain text.
Developer
simon_hain
Posts: 16,190
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: How to parse eml file in blackberry?

as it is not xml but more of a key-value pair i would say: loads of substring.
for starters you could create a hashtable with one entry for each line
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Contributor
ashokbb_narra
Posts: 13
Registered: ‎02-26-2013
My Device: blackberry curve 8520

Re: How to parse eml file in blackberry?

If we go with substring then logic will be complex..that too we dont know the delimiter where to split also.I searched for API's ,but i didnt find.

Please use plain text.
Developer
simon_hain
Posts: 16,190
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: How to parse eml file in blackberry?

well, it seems that the linebreak would be a good start.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Contributor
ashokbb_narra
Posts: 13
Registered: ‎02-26-2013
My Device: blackberry curve 8520

Re: How to parse eml file in blackberry?

In some cases one tag data will be multiple lines.so it will be problem right?.can u give me sample code to implement this feacture by applying ur idea. 

Please use plain text.
Developer
simon_hain
Posts: 16,190
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: How to parse eml file in blackberry?

string manipulation is kind of programming 101, if you find yourself challenged by that you could maybe find some courses, read some beginner books etc.

asking for "sample code" to solve a specific problem is contradictory, and requesting that other developers do your (probably paid) work for free is kind of rude.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
New Contributor
berryian
Posts: 7
Registered: ‎08-08-2009
My Device: Not Specified

Re: How to parse eml file in blackberry?

An eml file is in mime format, so you can't just parse it as key-value strings.

 

It's probably too difficult to try writing a mime parser all by yourself, so try looking for java mime parsers on the web.

 

For example: follow the suggestions here

Please use plain text.