Question

1
Replies
45
Views
Ganesh.bhat@ap.jll Member since 2019 2 posts
Posted: November 6, 2019
Last activity: March 16, 2020

Special characters appearing in email

Hi,

Special characters are being sent in email for some of the customers. We are using soap request to fetch the body of the email from external system and in response we get Base 64 encoded string. When i try to decode that string in notepad++, i can see the charset is iso-8859-1. However we are decoding it using below java

try{

decodedContent = new String(javax.xml.bind.DatatypeConverter.parseBase64Binary(encodedContent));

}

and the decodedContent is set to .pyBody in pyCorrPage.

While sending the email message to customer, we are usoing below code where i can see charet is mentioned as UTF-8

MimeBodyPart msgPart = new MimeBodyPart();

if( emailType.equals("HTML") ){

msgPart.setContent(msgBodyText, "text/html; charset=\"UTF-8\"");

}else{

msgPart.setContent(msgBodyText, "text/plain; charset=\"UTF-8\"");

}

multipart = new javax.mail.internet.MimeMultipart();

multipart.addBodyPart(msgPart);

//multipart = SMIMEgen.generate(msgPart, "BC");

}catch (Exception Any){

String strStatus = "SendEmailMessage: Could not set up e-mail signing: \n" + Any.toString();

oLog.error(strStatus);

return strStatus;

}

Also we are using microsoft exchange to send the emails.

This issue is happening to few customers and wherever we have &nbsp in html code is replaced with special character.

Can anyone please help me with this issue.

***Moderator Edit-Vidyaranjan: Updated Platform Capability***

Low-Code App Development Case Management
Share this page LinkedIn