简体   繁体   中英

Javax.mail - Cannot get different values from bodypart type

I have a problem while getting different lines on the Content-Disposition of an email.

The source code of the email message appears to me like this:

MIME-Version: 1.0

-----=_Part_0_1360890360.1452693261504
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

File Attached
------=_Part_0_1360890360.1452693261504
Content-Type: application/octet-stream;
    name*0="privat_20140711133201_7702_01_20140117-FPLux-AERT-reporting";
    name*1="-amended-between-31.12.2011-to-31.12.2013.xls"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
    filename*0="privat_20140711133201_7702_01_20140117-FPLux-AERT-reporting";
    filename*1="-amended-between-31.12.2011-to-31.12.2013.xls"

The file is somehow being separated from each other. When running a debug on my code the second name or filename does not appear, only the first value. In this case only application/octet-stream;name=privat_20140711133201_7702_01_20140117-FPLux-AERT-reporting . The other part simply disappear.

Can someone please help me know how to get the filename*1 to concat both strings?

Thank you

You're probably using an old version of JavaMail. Upgrade to the latest version , which handles this for you. Or, for JavaMail 1.4.1 or newer, set the System property mail.mime.decodeparameters to "true".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM