Archived Forum Post

Index of archived forum posts

Question:

Extract the Email message body from S/MIME encrypted mail

Dec 13 '12 at 10:17

I've S/MIME encrypted mail and successfully decrypted it. when i used the following code,

string mimeEmail = email.GetMime();

it returns the full email(header,body and etc) with mime string , i wonder how to extract only the message body. Needs help.

Kumar.


Answer

Assuming this is Java???

See the Java Email Object Examples

Specifically, see the Java example to get an email body.


Answer

thanks for the quick reply ..forget to mention the language. pardon me.. i've been using C#. I checked the Mailman.Decrypted property and its returns true.

But if i use GetPlainTextBody() of the email object ,it returns empty. So i've used mailman.GetMime()..it returns the full email(header,body and etc) with mime string. how to extract only the body from email.


Answer

It's impossible for me to know unless I can see the exact MIME for the email (after decryption).


Answer

Return-Path: <abc@abc.com> Delivery-Date: Thu, 06 Dec 2012 08:19:35 -0500 Received: from mout.perfora.net (mout.perfora.net [74.208.4.195]) by mx.perfora.net (node=mxus0) with

ESMTP (Nemesis) id 0Lik1l-1TApuk1Xw5-00d0NT for 123@123.com; Thu, 06 Dec 2012 08:19:35 -0500 Received: from ABC10 ([103.3.230.115]) by mrelay.perfora.net (node=mrus4) with ESMTP (Nemesis) id

0Mhi4R-1TUH8y2P47-00MySd; Thu, 06 Dec 2012 08:19:34 -0500 From: "user" <abc@abc.com> To: <123@123.com> Subject:Report Date: Thu, 6 Dec 2012 18:49:32 +0530 Message-ID: <@test.com">002601cdd3b4$56b21da0$041658e0$@test.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0027_01CDD3E2.706E2A30" X-Mailer: Microsoft Outlook 14.0 Thread-Index: Ac3TtE7yTZcVVtllSdagYTwwc6wA1Q== Content-Language: en-us X-Provags-ID: V02:K0:nOGebzy1l4cyLoyTzIwEDqjGgh5MGmYT/DkVXdhrKFQ

k8ebGvMxgGHDBBRWiBBfwu1SKslDv5aJepAQHSrHLIZnSb4sBg 2wHUVjMPTFpE2BnHniWF6k0Fv9K4OMAM9ksj37+qUra0pz+EM+

wHOjZ36+aTrwi7gmnoSk+XLx2pupYVjsgybxgEzKn2SsgDv4tX rtNE1BIOh/MRfoc1m3f2oDh75ZZ7hHf0CgPkBuBF3ixgfOqI/4

Z70sZN1L/rVOgN+qRc8wUwviTfmMfjY2CqkSS4PkYLsBTW5Bmi k4AKmuHlqNeNxTdgswRtqoz9pdKFTvriXMi08DNlzcADfu+dQv

88LibtJHKI4Tt+A/GgszHpXB6ONTxqufRCRBSvmjg X-UI-Loop: V01:4cnavN5NSkU=:8KcQTIOyoH+LfddxQW8RATDNsRu9KaXvjZBjAj8bD/E= Envelope-To: 123@123.com X-UIDL: 0Lik1l-1TApuk1Xw5-00d0NT

------=_NextPart_000_0027_01CDD3E2.706E2A30 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0028_01CDD3E2.706E2A30"

------=_NextPart_001_0028_01CDD3E2.706E2A30 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit

------=_NextPart_001_0028_01CDD3E2.706E2A30 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

<html xmlns:v="3D"urn:schemas-microsoft-com:vml"" xmlns:o="3D"urn:schemas-micr=" osoft-com:office:office"="" xmlns:w="3D"urn:schemas-microsoft-com:office:word"" =="" klzzwxh:0010="" office="" 2004="" 12="" omml"="" xmlns="3D"http:=" klzzwxh:0011="" tr="" rec-html40"=""><head><meta http-equiv="3DContent-Type" content="=3D"text/html;" charset="3Dutf-8""><meta name="3DGenerator" content="3D"Microsoft=" word="" 14="" (filtered="" medium)"=""><style></style></head><body lang="3DEN-US" link="3Dblue" vli="nk=3Dpurple">

<o:p>&nbs= p;</o:p>

</body></html> ------=_NextPart_001_0028_01CDD3E2.706E2A30--

------=_NextPart_000_0027_01CDD3E2.706E2A30

#########################################################################-

-----------------------------------------------------------------------------#-

-------------------------------------------------------#-

---------------------S-T-A-T-U-S-------R-E-P-O-R-T---------------------------#-

---------------------DATE: 11/09/2012 TIME: 09:18:47 # #

                                                   #

DISK SPACE USED / AVAILABLE:

                                          TOTAL     USED      AVAIL     CAP

FILESYSTEM: /dev/dsk/c1t0d0s0 MOUNT: / FILE SPACE: 15127920 5499426 9477215 37% INODES: 61901 1761011 3%


FILESYSTEM: /dev/dsk/c1t0d0s7 MOUNT: /usr FILE SPACE: 11827273 5025627 6683374 43% INODES: 171412 1255468 12%


FILESYSTEM: dev/dsk/c2t9d0s0 MOUNT: /export/home1 FILE SPACE: 70593497 28156583 41730980 41% INODES: 222473 8274743 3%


FILESYSTEM: dev/dsk/c2t9d0s8 MOUNT: /export/home2 FILE SPACE: 719688745 317508472 402180272 45% INODES: N/A N/A N/A N/A



END OF REPORT

------=_NextPart_000_0027_01CDD3E2.706E2A30--

The above is mime content of a decrypted email.

Thanks Kumar.