Skip to content

Simple Java Mail should tailor the MimeMessage structure to specific needs #144

@bbottema

Description

@bbottema

Currently Simple Java Mail uses standardized structure that can handle attachments, embedded images, email forwards, text, HTML and iCalendars:

 - mixed
 	- related
 		- alternative
 			- mail tekst
 			- mail html tekst
 			- iCalendar tekst
 		- embedded images
 	- forwarded message
 	- attachments

However, this means the structure is not always fully populated, for example when there are no attachments the Multipart "mixed" contains only the actual content. Or when there are no embedded images the Multipart "related" only contains the text or HTML. This is fine, except that some email clients are unable to deal with this. For example, the mere presence of a Multipart "mixed" causes Outlook 365 to always show an attachment icon in the mail list, even though there are no attachments.

To solve this, Simple Java Mail should be more flexible in the Multipart structure it uses depending on actual use. This means the resulting structure will always be a subset of the current standardized structure unless all email fields are being used (necessitating "related", "mixed" and "alternative" Multiparts).

Example of just plain text:

- mail tekst

Example of plain and HTML text:

 - alternative
 	- mail tekst
 	- mail html tekst

All possible combinations will get there own structure this way. Once implemented, the documentation will list all possible structures.

Solves #133 (thanks for the report @SoltauFintel).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions