When I send Chinese characters in the email using mail plugin the characters are displayed as a series of ? marks in the received email.
Is there a way I can set the character set for Chinese or is there a workaround.
Thanks!!
When I send Chinese characters in the email using mail plugin the characters are displayed as a series of ? marks in the received email.
Is there a way I can set the character set for Chinese or is there a workaround.
Thanks!!
Are you using html email?
I have faced the same with Arabic chars even when using html and UTF-8 encoded.
Hi Jan,
I have this error for both html and plain text emails
Thanks!
Hi Hameed and Mohamad,
Are you both setting the mail.mime.charset property in the servoy admin pages (Server Plugin Settings)?
are you guys setting these properties then to the right value:
“mail.mime.encoding” and “mail.mime.charset”
Yeah I missed that.
Now I set “mail.mime.charset=UTF-8” and it seems to work
Thanks for you help!
Mine is set as below, had to do it for Japanese.
Everything works except file attachment names still have a problem. I just haven’t had the time to narrow all the specifics yet and make a support case for it.
Also beware of free email providers because some aren’t yet set for utf-8 like hotmail is one I can think of.
mail.mime.charset=UTF-8
mail.mime.encoding=8bit
Steve
If I use multi byte chars like chinese the subject always comes as ???
Can you please help? Thanks!
Hi Hameed,
What version of Servoy are you using ? I seem to remember they fixed the subject encoding a while ago.
I am using the following version:
Servoy Developer
Version 3.5.1-build 514
Java version 1.5.0_11-b03 (Windows XP)
Should I upgrade?
faheemhameed:
Should I upgrade?
Well at least test it with 3.5.6.
3.5.4 had a fix in the mailplugin for a reported issue with Kanji so that might be related.
I can’t seem to find the forum thread on the mail-subject encoding though.
Hope this helps.
Ok I will. Thanks!
I have upgraded to the following version:
Servoy Developer
Version 3.5.6-build 519
Java version 1.5.0_11-b03 (Windows XP)
I still have the same issue. Can anyone help here?
Thanks a lot!
Hi Hameed,
I suggest you file a bugreport in the support system
I have changed some of the lines in the MailServer.java as follows and that fixed my issues
// create a new MimeMessage object (using the Session created above)
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.setSentDate(new Date());
addRecipients(message, to, Message.RecipientType.TO);
addRecipients(message, cc, Message.RecipientType.CC);
addRecipients(message, bcc, Message.RecipientType.BCC);
//message.setSubject(subject==null?Messages.getString("servoy.plugin.mailserver.defaultsubject"):subject);
subject = (subject==null) ? Messages.getString("servoy.plugin.mailserver.defaultsubject") : subject;
message.setSubject(subject, "utf-8");
Can servoy staff update their plugin with this fix so that it will not mess up my copy of the plugin in the next update?
Thanks a lot.
Not all mail clients support UTF-8 (one of those being Outlook < 2003). On those clients such a message looks terrible. So I think this should be an option only.
For me the changed code is just fine for now.
But can you please let me know how this code has to be adjusted to make this as an option? OR servoy guys can make it in the next version.
The default option could just be utf-8. What do you think?
Is there way we can do it by setting a property like this mail.mime.charset=UTF-8?
Do we have something like mail.mime.subjectCharset=UTF-8 ?
I tried using the modified version of the above mail plugin in servoy server. When I try to send emails from the servoy client I got the following error. Please help!
Jul 9, 2008 7:53:16 PM com.servoy.j2db.util.Debug error
SEVERE: Error getting the service servoy.IMailService from host 202.155.218.34:1088
java.rmi.NotBoundException: servoy.IMailService
at sun.rmi.registry.RegistryImpl.lookup(Unknown Source)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
at com.servoy.j2db.J2DBClient.getServerService(Unknown Source)
at com.servoy.j2db.plugins.ClientPluginAccessProvider.getServerService(Unknown Source)
at com.servoy.extensions.plugins.mail.MailProvider.createMailService(MailProvider.java:119)
at com.servoy.extensions.plugins.mail.MailProvider.js_sendMail(MailProvider.java:207)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:334)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1254)
at org.mozilla.javascript.gen.c133.call(local_functions_broadcast_sendBroadcast:98)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1254)
at org.mozilla.javascript.gen.c942.call(onShow:13)
at com.servoy.j2db.scripting.f.executeFunction(Unknown Source)
at com.servoy.j2db.FormController.a(Unknown Source)
at com.servoy.j2db.FormController.a(Unknown Source)
at com.servoy.j2db.FormController.byte(Unknown Source)
at com.servoy.j2db.FormController.access$1200(Unknown Source)
at com.servoy.j2db.FormController$3.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at com.servoy.j2db.util.JEscapeDialog.setVisible(Unknown Source)
at com.servoy.j2db.l.setVisible(Unknown Source)
at com.servoy.j2db.j.a(Unknown Source)
at com.servoy.j2db.scripting.JSApplication.js_showFormInDialog(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:334)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1254)
at org.mozilla.javascript.gen.c95.call(act_specialAction:44)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1254)
at org.mozilla.javascript.gen.c299.call(mod_functions_act_specialAction:11)
at com.servoy.j2db.scripting.f.executeFunction(Unknown Source)
at com.servoy.j2db.FormController.a(Unknown Source)
at com.servoy.j2db.FormController.executeFunction(Unknown Source)
at com.servoy.j2db.FormController.actionPerformed(Unknown Source)
at com.servoy.j2db.FormController$a.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener$Actions.actionPerformed(Unknown Source)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)