Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

while setting plain text in email, it is sent as html and hence all the line breaks are eliminated. #5

Open
santosh103 opened this issue Sep 8, 2020 · 2 comments

Comments

@santosh103
Copy link

while setting plain text in email, it is sent as html and hence all the line breaks are eliminated.

@gartcimore
Copy link
Owner

Do you have a sample of what you are doing and what is wrong ?

@gartcimore
Copy link
Owner

gartcimore commented Oct 4, 2020

    // Create message
    MimeMessage lMessage = new MimeMessage(session);
    lMessage.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    lMessage.setSubject("Hello World!");
    lMessage.setText("LineBreak after\n this is a new line\n another new line");

        lMessage.addHeaderLine("X_MY_Custom_Header=myValue");

        //Send the mail via EWS
        lTransport.sendMessage(lMessage, lMessage.getRecipients(Message.RecipientType.TO));

and got the following content

Content-Language: en-US
Content-Type: text/plain; charset=WINDOWS-1252
Content-Transfer-Encoding: quoted-printable

LineBreak after
 this is a new line
 another new line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants