Hi,
I am trying to send email in Chinese, but the below code only sends body part garbled message.
try{
sun.net.smtp.SmtpClient smtp = new sun.net.smtp.SmtpClient("smtp.xxxx.org");
smtp.from((String)ResourceUtils.getResourceValue("xxx.replyEmail"));
smtp.to(to);
PrintStream msg = smtp.startMessage();
msg.println("To: " + to);
msg.println("Subject: "+subject);
msg.println();//start of the body :
msg.println(body);
smtp.closeServer(); //sent
}catch(Exception e){
log.error(e);
}
Open in new window
I debugged that body variable contains correct Chinese characters.
Any ideas?
thanks,
http://www.coderanch.com/t/326084/java/java/Sending-Unicode-SMTPClient