emiliosetiadarma commented on code in PR #6193:
URL: https://github.com/apache/nifi/pull/6193#discussion_r919305097


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java:
##########
@@ -362,17 +373,26 @@ public void onTrigger(final ProcessContext context, final 
ProcessSession session
             }
             this.setMessageHeader("X-Mailer", 
context.getProperty(HEADER_XMAILER).evaluateAttributeExpressions(flowFile).getValue(),
 message);
             
message.setSubject(context.getProperty(SUBJECT).evaluateAttributeExpressions(flowFile).getValue());
+            message.setSentDate(new Date());
 
             final String messageText = getMessage(flowFile, context, session);
-
             final String contentType = 
context.getProperty(CONTENT_TYPE).evaluateAttributeExpressions(flowFile).getValue();
-            message.setContent(messageText, contentType);
-            message.setSentDate(new Date());
+            final Charset charset = getCharset(context);
+            final String charsetName = MimeUtility.mimeCharset(charset.name());
+            final DataHandler messageDataHandler = new DataHandler(

Review Comment:
   Yeah it will encode the body text into base64. I figured out that the 
existing implementation of PutEmail used base64 encoding of body text when the 
`ATTACH_FILE` property is set to true. 
   
   Just extended it to the non `ATTACH_FILE` case and made sure to set the 
appropriate header. If I hadn't done that, the email sent would have a 
`Content-Transfer-Encoding` of `7-bit` which can only represent US-ASCII 
characters



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to