简体   繁体   中英

Encoding problem while sending email using java mail API

I am sending email using java mail api in my application. The subject of email contains hyphen( - ) character. This works fine on windows machine. But once I deploy the application on linux machine, the recipients of email get emails with hyphen getting converted into question mark in the subject of emails.

This problem is occurring in Cent OS linux environment. This is working fine with windows and ubuntu linux environment.

Can somebody please suggest what could be the problem?

Thanks.

Are you sure the hyphen character is actually the regular ASCII hyphen (0x2D)? If it's something that looks like a hyphen, but is actually a Unicode character from a different language set, you could easily see encoding problems across environments.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM