Apache Commons E-Mail-Codierung mit base64 anhängen
Ich versuche, eine Base64-verschlüsselte Datei über zu sendenapache.commons.mail
und ich kann einfach nicht nähen, um das zu bekommenContent-Transfer-Encoding: base64
Header, wohin es gehen soll.
<code>// Create the email MultiPartEmail email = new MultiPartEmail(); email.setSmtpPort(587); email.setDebug(false); email.setHostName("smtp.gmail.com"); email.setAuthentication("[email protected]", "password"); email.setTLS(true); email.addTo("[email protected]"); email.setFrom("[email protected]"); email.setSubject("subject"); email.attach(new ByteArrayDataSource( Base64.encodeBase64(attachFull.getBytes()), "text/plain"), "samplefile.txt", "sample file desc", EmailAttachment.ATTACHMENT ); </code>
Und das kommt zum Empfänger.
<code>------=_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 </code>
Wie kann ich angeben, dass die Datei Base64-codiert ist?