我有一个应用程序,通过发送带有附件的电子邮件与其他服务器进行通信。
我使用Apache Commons Email发送带有附件的电子邮件,如下所示:
MultiPartEmail email = new MultiPartEmail();
email.setHostName(sHostName);
email.addTo("bob@bob.com");
email.addFrom("andy@andy.com");
email.setSubject("the subject");
email.setMsg("the message");
byte[] documentFile = /* ... */;
String filename = "my file.pdf";
String description = "this is my file";
email.attach(new ByteArrayDataSource(myPDF, "application/pdf"), filename, description, EmailAttachment.ATTACHMENT);
email.send();
问题在于,另一端的人说“标题信息具有Content-Transfer-Encoding值为“7bit”,需要更改为“quoted-printable”。
我的问题是,我该如何进行更改,以使文件以适当的方式附加?
罗布