Hi
I send mail with javax.mail.internet.MimeMessage. My attachment is a PDF. I receive my mail and my PDF is perfect, but when the name of my PDF file contains accentuated characters(é è à ç...) these ones disappear.
ex : Stéphane.pdf ---> Stphane.pdf
I don't know well the rules of encoding and even less for the email.
anybody have an idea ?
code :
MimeMessage message = createMessage(fromAddress,
replyTo, to, cc, bcc, subject);
MimeMultipart mp = new MimeMultipart();
MimeBodyPart attachPart = new MimeBodyPart();
String attachmentFileName = null;
attachPart.setFileName(attachment.getName());
RSBytesArrayDataSource ds = new RSBytesArrayDataSource(attachment.getBinaryBody(), attachment.getContentType().getMimeType());
DataHandler dh = new DataHandler(ds);
attachPart.setDataHandler(dh);
mp.addBodyPart(attachPart);
message.setContent(mp);
message.saveChanges();
I send mail with javax.mail.internet.MimeMessage. My attachment is a PDF. I receive my mail and my PDF is perfect, but when the name of my PDF file contains accentuated characters(é è à ç...) these ones disappear.
ex : Stéphane.pdf ---> Stphane.pdf
I don't know well the rules of encoding and even less for the email.
anybody have an idea ?
code :
MimeMessage message = createMessage(fromAddress,
replyTo, to, cc, bcc, subject);
MimeMultipart mp = new MimeMultipart();
MimeBodyPart attachPart = new MimeBodyPart();
String attachmentFileName = null;
attachPart.setFileName(attachment.getName());
RSBytesArrayDataSource ds = new RSBytesArrayDataSource(attachment.getBinaryBody(), attachment.getContentType().getMimeType());
DataHandler dh = new DataHandler(ds);
attachPart.setDataHandler(dh);
mp.addBodyPart(attachPart);
message.setContent(mp);
message.saveChanges();