javamail 发送csv附件不完整解决

MimeBodyPart attachment = new MimeBodyPart();
            DataSource ds = new FileDataSource(fileAttachment) {

               public String getContentType() {
                  return "text/csv";
               }
            };
            attachment.setDataHandler(new DataHandler(ds));
            attachment.setFileName(fileAttachment.getName());
            attachment.setDisposition(Part.ATTACHMENT);
            multipart.addBodyPart(attachment);
            attachment.setHeader("Content-Transfer-Encoding", "base64");
原地址: https://community.oracle.com/thread/1590245?start=0&tstart=0

你可能感兴趣的:(java)