The situation: I'm trying to fix some code which is using a Java backend to send automated emails using Velocity Mail Manager.
The problem: The subject is set in the Java code like String subject = "Hello - what's next?";
. It's then set to the message object (a MimeMessage) with message.setSubject(subject);
However, when the email is sent, the subject line renders as: "Hello – what's next?"
What I've tried: I've searched for solutions and came up with this question which is what made me think it's a problem with encoding. I worked through the various methods which are called to send the email, and can't find anything that sets the encoding though. I also checked the email template itself and the encoding there is set like so:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
What I'm looking for: I need to know either a) How to find out from my code which encoding to use in my HTML, or b) how to set the encoding of the subject line IN Velocity Mail Manager. (Or c) any other tips to solve the problem.)
Thanks!