views:

1461

answers:

7

It appears the Indy 10 SMTP component shipped with Delphi 2009 do not properly support unicode in the subject and body.

Does anyone know of a good alternative, or has anyone made the necessary changes to Indy10 to solve this issue?

Update: Thanks for all the answers, I've done a bit of investigation, and thought I might be able to solve the issue by sending unicode chars in the HTML section of an email. Anyone any opinions on whether that will do the trick?

+1  A: 

I would definitely look at IPWorks from nSoftware.com. Their latest version is supposed to be fully Delphi 2009 compliant.

Darian Miller
+3  A: 

I would also note that most mail servers may not handle Unicode properly in the mail subject line. I haven't seen any real statistics on this, but my guess is that a very healthy percentage of mail servers still expect ascii subject lines as I believe that's what the RFC's define.

(The message body can of course be encoded to ensure it goes through.)

Darian Miller
This is why you might want a component that could take your UTF-8 data and automatically format it for sending via SMTP -- see http://www.perlmonks.org/?node_id=692745
Scott W
RFC 2047 defines how to put non-ASCII characters in the ASCII-only subject. http://www.faqs.org/rfcs/rfc2047.html
Rob Kennedy
+1  A: 

I would look at Synapse which does properly handle unicode in the subject and body. You will need to download the repository via the SVN repository, which is more up to date than the version listed for download on the website. The SVN version includes support for Delphi 2009.

skamradt
Can you explain how Synapse "properly" handles Unicode in the subject line? How does it work with 7-bit servers?
Darian Miller
I would imagine it simply follows RFC 2047.
Rob Kennedy
Follows the RFC 2047 specifications by properly encoding the subject line. I have many customers who use my product to support various other character sets and it works wonderfully.
skamradt
+1  A: 

EasyMail says it supports RFC 2047 which Rob mentioned as handling non-ascii subject lines:

http://www.componentsource.com/products/easymail-objects/summary.html

Darian Miller
A: 

A bug was recently discovered in Indy 10's IdHeaderoderUTF class that would prevent UTF-7 and UTF-8 from working properly when encoding email headers that have Unicode characters in them.

A: 

Thanks to everyone for the suggestions, I think I've found a component that really works. Its an ActiveX rather than Delphi component, but does the trick. Nice and simple.

The component is The Chilkat SMTP component . The code example here does exactly what I want and it works!!!

Toby Allen
I think this is worst option
Francis Lee
Thanks Francisco would you like to elaborate?
Toby Allen
+2  A: 

Indy 10 has been updated since D2009's initial release to handle Unicode better now. Have a look at the current Tiburon snapshot in Indy's SVN.

Remy Lebeau - TeamB