You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/09/29 20:48:21 UTC

[jira] [Commented] (NIFI-1912) PutEmail doesn't send formatted email when there is an attachment with the message

    [ https://issues.apache.org/jira/browse/NIFI-1912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15534008#comment-15534008 ] 

ASF GitHub Bot commented on NIFI-1912:
--------------------------------------

GitHub user pvillard31 opened a pull request:

    https://github.com/apache/nifi/pull/1081

    NIFI-1912 - PutEmail fixed format when attachment

    Correction as suggested by users in JIRA.
    + adding a unit test to check attachments.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/pvillard31/nifi NIFI-1912

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/1081.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1081
    
----
commit 007430f706a936e4e46b013aa7e30b11ed7bd0af
Author: Pierre Villard <pi...@gmail.com>
Date:   2016-09-29T20:47:04Z

    NIFI-1912 - PutEmail fixed format when attachment
    
    Correction as suggested by users in JIRA.
    + adding a unit test to check attachments.

----


> PutEmail doesn't send formatted email when there is an attachment with the message
> ----------------------------------------------------------------------------------
>
>                 Key: NIFI-1912
>                 URL: https://issues.apache.org/jira/browse/NIFI-1912
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 0.6.1
>            Reporter: Ravi Bhushan Ratnakar
>            Priority: Critical
>             Fix For: 1.1.0
>
>
> When I am trying to send formatted email with an attachment using PutEmail processor, all the html tags are displayed as it is like a text(<b>This</b>).
> After going through the code what i observed that when there is an attachment, in that case content type is hard coded to 'text/plain'. Below code  snippet from PutEmail 
> if (context.getProperty(ATTACH_FILE).asBoolean()) {
>                 final MimeBodyPart mimeText = new PreencodedMimeBodyPart("base64");
>                 mimeText.setDataHandler(new DataHandler(new ByteArrayDataSource(
>                         Base64.encodeBase64(messageText.getBytes("UTF-8")), "text/plain; charset=\"utf-8\"")));



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)