Skip to content

Just send plain text mail #133

@SoltauFintel

Description

@SoltauFintel

Great lib! But how can I send a just plain text mail? My mail has no attachments and no HTML part.

If I use

		mailer.sendMail(EmailBuilder.startingBlank()
				.to(to)
				.from(fromName, fromMailAddress)
				.withSubject(subject)
				.withPlainText(plainText)
				.clearHTMLText()
				.buildEmail());

the received mail contains this:

Content-Type: multipart/mixed; 
	boundary="----=_Part_0_1023714065.1521359548014"
(...)
------=_Part_0_1023714065.1521359548014
Content-Type: multipart/related; 
	boundary="----=_Part_1_1599771323.1521359548027"

------=_Part_1_1599771323.1521359548027
Content-Type: multipart/alternative; 
	boundary="----=_Part_2_1876631416.1521359548027"

------=_Part_2_1876631416.1521359548027
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Dies ist ein Test.
=C3=84=C3=96=C3=9C=C3=9F
2018-03-18T08:52:27.960
------=_Part_2_1876631416.1521359548027--

------=_Part_1_1599771323.1521359548027--

------=_Part_0_1023714065.1521359548014--

As far as I understand SMTP it should be possible to send just plain text without the use of MIME parts (if there are no attachments and no HTML part). Background: My Thunderbird mail app thinks at the first second the mail contains an attachment. It shows the paperclip icon for a second. When I open the mail it shows it very well.

I use this jitpack version: compile 'com.github.bbottema:simple-java-mail:5.0.1'

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions