Skip to content

Commit 52bd831

Browse files
author
David Bauer
committed
MimeMessageHelper: use complete filename as resource name
Mail for Windows 10 uses the name property of the Content-Type as the displayed filename, regardless of the filename set. As the Content-Type name misses the extension, attachments can not be opened with the preferred application. Fix this by adding the extension to the Content-Type name. Signed-off-by: David Bauer <[email protected]>
1 parent c6abd4f commit 52bd831

File tree

1 file changed

+1
-1
lines changed
  • modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage

1 file changed

+1
-1
lines changed

modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ private static BodyPart getBodyPartFromDatasource(final AttachmentResource attac
237237
final String contentType = attachmentResource.getDataSource().getContentType();
238238
ParameterList pl = new ParameterList();
239239
pl.set("filename", fileName);
240-
pl.set("name", resourceName);
240+
pl.set("name", fileName);
241241
attachmentPart.setHeader("Content-Type", contentType + pl.toString());
242242
attachmentPart.setHeader("Content-ID", format("<%s>", resourceName));
243243
attachmentPart.setDisposition(dispositionType);

0 commit comments

Comments
 (0)