base64でエンコードされたファイルを経由で送信しようとしていますが、ヘッダーapache.commons.mail
を取得するためにシームすることができません。Content-Transfer-Encoding: base64
// Create the email
MultiPartEmail email = new MultiPartEmail();
email.setSmtpPort(587);
email.setDebug(false);
email.setHostName("smtp.gmail.com");
email.setAuthentication("from@gmail.com", "password");
email.setTLS(true);
email.addTo("to@example.com");
email.setFrom("from@example.com");
email.setSubject("subject");
email.attach(new ByteArrayDataSource(
Base64.encodeBase64(attachFull.getBytes()), "text/plain"),
"samplefile.txt",
"sample file desc",
EmailAttachment.ATTACHMENT
);
そして、これが受信者に届くものです。
------=_Part_0_614021571.1334210788719
Content-Type: text/plain; charset=Cp1252; name=texto.txt
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename=samplefile.txt
Content-Description: sample file desc
ファイルがBase64でエンコードされていることを指定するにはどうすればよいですか?