javamail + mysql = wrong insertion of an apostrophe
Rodrigo Bossini
Ranch Hand
Joined: Jul 03, 2009
Posts: 106
posted
0
Hi,
I'm using javamail API to download emails from an email inbox. ONce downloaded, my app inserts the message field from the email to a table in mysql.
This message is a simple text. There are no email signatures nor attachements. The message is inserted completely to the table, but it also inserts an apostrophe with the message.
Has anyone seen this problem before? What could possibly cause such a problem?
Actually, my application was inserting a double quotes (instead of an apostrophe) mistakenly in the destinatary field (instead of in the message field).
And I found out what the problem was.
Say you are using outlook to send emails, and you add your usual emails as contacts.
When you send a new email to that contact, the destinatary field is formatted like the following:
There is the problem. My application was prepared to dealing with <yourcontactEmailAdress@domain.com> but not with "yourcontactEmailAdress@domain.com".