Java mail send mail attachments appear .eml folder

When using JAVA MAIL send mail, the mailbox 163 and QQ-mail attachments received PDF, malformed follows:

163 E-mail:

QQ E-mail:

 

Through a very long period of research and testing, MimeBodyPart object cause of the error is in the message body and attachments with the message is the same one, which led to the above phenomenon, the solution is for the body of a MimeBodyPart object, an annex is a MimeBodyPart object. The correct code is as follows:

 

Guess you like

Origin www.cnblogs.com/XH09/p/10981329.html