This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Send Japanese Characters In Java Mail

 
Nitin Sinha
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been using the following code in my program to send mail in English -

But, now I have a requirement to send Japanese characters in mail.
I tried to google alot but couldn't find a viable solution.
Can anyone assist me with the code (if possible)

When I try to harcode Japanese Characters ino Subject & Content Line, the mails outputs ??? in place of all the Japanese chractersets. Like this -

message.setSubject("全て半角英数字で");
message.setContent("定されていないシステム", "text/html");

I also tried using the code given at : http://www.example-code.com/java/java-japanese-email.asp

But this code throws me an exception stating :

java.lang.UnsatisfiedLinkError: new_CkMailMan
at com.chilkatsoft.chilkatJNI.new_CkMailMan(Native Method)
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nitin Sinha wrote:When I try to harcode Japanese Characters ino Subject & Content Line, the mails outputs ??? in place of all the Japanese chractersets.

How are you verifying this? Using the console? Because then maybe it's a console problem, not a JavaMail problem.
 
Nitin Sinha
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this Java Mail embedded in a servlet which is called upon submission of a JSP form which consolidates all the inputs from the user in a mail and mails them to me. Now, I want to allow user to enter Japanese characters in the inut boxes So those Japanese characters should get mailed to me too.

But this is other part of the story. Even if i try to hardcode anything in the mailer Body content, it returns a mail to me which has all ??? wherever I hardcode Japanese characters
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, so it shows up wrongly in a mail client that usually can handle Japanese characters.

Can you set the charset in the emails? I found a website that used the following code:
Surely you could try something similar?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic