• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

strange characters(?) added to the end of my subject text

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a problem with my java code sending email to users. There is some problem with the encoding of the email as When the email arrives to email account the subject line($subject) has encoding problems as has strange characters(?) added to the end of my subject text.

The email message content itself is fine just the subject line(?) I have searched all over but cant find,after using Unicode and content type as text/html mail body have no problem with special character
(ó) but same fix is not working for subject line.

I have a class that sends an email with javamail, with a text like
this one in subject :

"Estimado Iván Escobedo:


The problem is that when the mail arrives to its destination, it
arrives this way:

"Estimado Iv?n Escobedo:


All the á, é, í, ó, ú, etc special characters are replaced with "?".

What could be the problem and how to resolve it?

Thanks
Please advice
 
sanjay kumar gupta
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got Fix for this issue.extra char can be added in subject by using below code when we are setting subject :

mailNotificationHelper.setSubject((MimeUtility.encodeText(SubjectText, "ISO-8859-15", "Q")));
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic