Commit b9b05358 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Allowed to send non-latin symbols. JM-1378

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/branches@10458 b35dd754-fafc-0310-a699-88a17e54d16e
parent aba2136d
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* $Revision$ * $Revision$
* $Date$ * $Date$
* *
* Copyright (C) 2003-2005 Jive Software. All rights reserved. * Copyright (C) 2003-2008 Jive Software. All rights reserved.
* *
* This software is published under the terms of the GNU Public License (GPL), * This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution, or a commercial license * a copy of which is included in this distribution, or a commercial license
...@@ -171,7 +171,7 @@ public class EmailService { ...@@ -171,7 +171,7 @@ public class EmailService {
} }
else { else {
try { try {
String encoding = MimeUtility.mimeCharset("iso-8859-1"); String encoding = MimeUtility.mimeCharset("UTF-8");
MimeMessage message = createMimeMessage(); MimeMessage message = createMimeMessage();
Address to; Address to;
Address from; Address from;
...@@ -209,8 +209,9 @@ public class EmailService { ...@@ -209,8 +209,9 @@ public class EmailService {
content.addBodyPart(text); content.addBodyPart(text);
// HTML // HTML
MimeBodyPart html = new MimeBodyPart(); MimeBodyPart html = new MimeBodyPart();
html.setContent(htmlBody, "text/html"); html.setContent(htmlBody, "text/html; charset=UTF-8");
html.setDisposition(Part.INLINE); html.setDisposition(Part.INLINE);
html.setHeader("Content-Transfer-Encoding", "8bit");
content.addBodyPart(html); content.addBodyPart(html);
// Add multipart to message. // Add multipart to message.
message.setContent(content); message.setContent(content);
...@@ -221,6 +222,7 @@ public class EmailService { ...@@ -221,6 +222,7 @@ public class EmailService {
MimeBodyPart bPart = new MimeBodyPart(); MimeBodyPart bPart = new MimeBodyPart();
bPart.setText(textBody, encoding); bPart.setText(textBody, encoding);
bPart.setDisposition(Part.INLINE); bPart.setDisposition(Part.INLINE);
bPart.setHeader("Content-Transfer-Encoding", "8bit");
MimeMultipart mPart = new MimeMultipart(); MimeMultipart mPart = new MimeMultipart();
mPart.addBodyPart(bPart); mPart.addBodyPart(bPart);
message.setContent(mPart); message.setContent(mPart);
...@@ -230,8 +232,9 @@ public class EmailService { ...@@ -230,8 +232,9 @@ public class EmailService {
} }
else if (htmlBody != null) { else if (htmlBody != null) {
MimeBodyPart bPart = new MimeBodyPart(); MimeBodyPart bPart = new MimeBodyPart();
bPart.setContent(htmlBody, "text/html"); bPart.setContent(htmlBody, "text/html; charset=UTF-8");
bPart.setDisposition(Part.INLINE); bPart.setDisposition(Part.INLINE);
bPart.setHeader("Content-Transfer-Encoding", "8bit");
MimeMultipart mPart = new MimeMultipart(); MimeMultipart mPart = new MimeMultipart();
mPart.addBodyPart(bPart); mPart.addBodyPart(bPart);
message.setContent(mPart); message.setContent(mPart);
...@@ -492,4 +495,4 @@ public class EmailService { ...@@ -492,4 +495,4 @@ public class EmailService {
} }
} }
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment