我能夠從Spring應用程序發送的純文本電子郵件中生成阿拉伯語文本(تجاوزسعةمكدس)。文本在GMail和Thunderbird上正確顯示。這是我的郵件發送邏輯:
public void send(String fromAddress, String fromName,
String toAddress, String subject,
String template, Map<String, Object> model) {
MimeMessagePreparator preparator = new MimeMessagePreparator() {
public void prepare(MimeMessage mimeMessage) throws Exception {
MimeMessageHelper message = new MimeMessageHelper(
mimeMessage, "UTF-8");
message.setTo(toAddress);
message.setFrom(new InternetAddress(fromAddress, fromName));
message.setSubject(subject);
message.setText(VelocityEngineUtils
.mergeTemplateIntoString(velocityEngine, template, "UTF-8",
model));
}
};
mailSender.send(preparator);
}
謝謝你,真的解決了這個問題 – 2010-12-05 11:54:24