Indy E-Mail Problem (Indy 10, Delphi 2007)

Hello,



we use Indy 10 with Delphi 2007 to get E-Mail using IMAP.



We recieved an E-Mail which is not handled correctly. 



The E-Mail looks like this

{code}

Return-Path: <test@mail.com>;

From: "Test Tester" <test@mail.com>;

To: <test@mail.com>;

Subject: Order

Date: Wed, 7 Mar 2012 16:50:40 +0100

Message-ID: <15D526BEB8091D43859549D9E16E370FBA3123>

MIME-Version: 1.0

Content-Type: text/html; charset=US-ASCII

Content-Transfer-Encoding: quoted-printable

X-Mailer: Microsoft Outlook 14.0

Thread-Index: AQFk6K6fcF3cXh41JsTb8x8IMcCmxQ==

X-OlkEid: A704AF236F449F9DD6C8C0459AC95F1F2E7774B4



<html>

<head>

<meta http-equiv=3D"Content-Type" content=3D"text/html; =

charset=3DWindows-1252">

<meta name=3D"Generator" content=3D"Microsoft Exchange Server">

<!-- converted from rtf -->

<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; =

border-left: #800000 2px solid; } --></style>

</head>

<body>

<font face=3D"Times New Roman" size=3D"3"><span =

style=3D"font-size:12pt;"><a name=3D"BM_BEGIN"></a>

<div><font size=3D"2"><span style=3D"font-size:10pt;">  <br>



Sehr geehrte Frau XXXX,<br>



<br>



wir bestellen gem=E4ss anh=E4ngender Bestellung.<br>



<br>



Mit freundlichen Gr=FCssen<br>



Test Tester       <br>



<br>

</html>

{code}



This is what we got:

{code}

....

wir bestellen gem?ss anh?ngender Bestellung.<br>

....

{code}



And this is what we expected:

{code}

....

wir bestellen gemäss anhängender Bestellung.<br>

....

{code}



MS-Outllook and Thunderbird handle the E-Mail correctly.



I think Indy works correctly, but we still have to handle that E-Mail.



Any help would be appreciated.



Kind regards

Armin
0
Clemens
3/8/2012 12:00:03 PM
embarcadero.delphi.winsock 1874 articles. 2 followers. Follow

5 Replies
1510 Views

Similar Articles

[PageSpeed] 28

Am 08.03.2012 13:00, Clemens Maier wrote:

> Any help would be appreciated.

Did you try the current version 10.5.8, or the version in Delphi 2007 
(which is rather old)?

To test the new version, the components not have to be installed in the 
IDE. Just add the Core, System and Protocols path to the project search 
path.

Regards,
Michael Justin
0
Michael
3/8/2012 1:34:48 PM
We use  indy 10.5.7.
0
Clemens
3/8/2012 1:49:24 PM
Clemens wrote:

> The E-Mail looks like this

Your spacing is messed up, so it is difficult to know for sure if the email 
is malforrmed or not.  But offhand, one thing I notice is conflicting charsets 
values between the email's Content-Type header and the HTML's <meta> tag. 
 That could cause decoding issues.  Indy does not look at the <meta> tag, 
only the Content-Type header, and that header says the data is encoded as 
US-ASCII.  That would explain why all of your foreign characters are being 
translated into "?" characters.

--
Remy Lebeau (TeamB)
0
Remy
3/8/2012 5:46:54 PM
Hello.

> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> Clemens wrote:
> 
> > The E-Mail looks like this
> 
> Your spacing is messed up, so it is difficult to know for sure if the email 
> is malforrmed or not.  But offhand, one thing I notice is conflicting charsets 
> values between the email's Content-Type header and the HTML's <meta> tag. 
>  That could cause decoding issues.  Indy does not look at the <meta> tag, 
> only the Content-Type header, and that header says the data is encoded as 
> US-ASCII.  That would explain why all of your foreign characters are being 
> translated into "?" characters.
> 
> --
> Remy Lebeau (TeamB)

That's exactly what i figured out with my investigarions.

But there is still the question:
How do Thunderbird and Outlook handle this?

For historical reasons we use an older component to get E-Mails using POP3 (Internet Component Suite from François PIETTE (www.overbyte.be))
And that component can handle the mail too.

Kind regards
Armin
0
Clemens
3/9/2012 7:10:03 AM
Clemens wrote:

> How do Thunderbird and Outlook handle this?

They use the charset specified in the HTML <meta> tag if present.  The email's 
"Content-Transfer-Encoding" header specifies how to decode the email content 
into raw bytes, then the "Content-Type" header specifies what the bytes represent. 
 Since the bytes are HTML, and Thunderbird and Outlook recognize HTML, the 
raw bytes gets parsed for HTML <meta> tags that override what the email's 
headers say.  Thus the bytes get decoded using the Windows-1252 charset instead 
of the US-ASCII charset.  Indy's email components do not parse that deep 
(the TIdHTTP component does parse that deep for HTTP webpages, but you cannot 
use that for parsing HTML emails).  Fortunately, TIdIMAP4 has all kinds of 
methods available for retreiving bits and pieces of emails, so I'm sure you 
can come up with a way to get access to the raw bytes and parse them yourself 
when you detect an HTML Content-Type.  Look at TIdIMAP4's RetrieveStructure(), 
RetrievePartHeader(), and RetrievePart() methods as a starting point.

--
Remy Lebeau (TeamB)
0
Remy
3/9/2012 8:44:33 AM
Reply:

Similar Artilces:

Converting Delphi 2007 Indy 10.2.3 to Delphi 2009 Indy 10.5.5 [Edit]
Hello, I am currently attempting to port over a Delphi 2007 project that uses Indy 10.2.3 (very successfully) to Delphi 2009 and Indy 10.5.5 (I just got the latest development build this morning). I think I am running into an encoding issue, but am not sure. Specifically, IDHTTP with SSL calls an old CGI and the CGI returns a .zip file and I then save it to the disk. In 2007 and before this worked perfectly. In 2009, it is not. Here is the examples of the 2 different results (though cut way short in the post) I am getting back: 2007: 'PK'#3#4#$14#0#0#0#8#0'rLQ9žrPb€'#0...

migrating from Delphi 6 With Indy 10 to XE7 with Indy 10
I updated the original Indy in D6 to version 10 several years ago. Now I want to migrate my application from D6 to XE7 and would like some feedback on the best route to take. I usually send data using readln and writeln statements. The data is typically XML format. Since migrating to XE7 will include potential unicode data what is the best approach to take when reading and writing data? Will writeln and readln work in these cases or should I be using a different strategy to send unicode data between the tidtcpclient and tidtcpserver applications? al wrote: > I usually send data ...

delphi 7 Indy 9 and Indy 10
Hi, I can upgrade to indy 10 in delphi 7. But I have discover that indy 9 and Indy 10 have some different properties, so i had to change my old programs that were made in indy 9 to upgrade it to new version, but it is a long work. So I want to know if it is possible to install in the same delphi 7 both versions indy 10 and indy 9. I have tried to do it but i received a error message: Cannot load package 'IndySystem70'. It contains unit 'IdWinSock2', which is also contained in package 'Indy70'. Some can give me ideas or a link to read how to install both versi...

Indy IdHMACSHA1 different results in Delphi 2007 and Delphi 2009
Hello newsgroup A test of the IdHMACSHA1 encryption method shows different results, and I am not sure if there is an error in my code or in the Indy code shipped with Delphi 2009. The Delphi 2007 version works in an application which communicates with Amazon Web Services and so it seems to be the correct one. Any suggestions are very welcome, maybe I just need to download a newer version of Indy? program Test; {$APPTYPE CONSOLE} uses IdHMACSHA1, IdCoderMIME, IdGlobal, SysUtils; function Base64Encode(const Input: string): string; begin Result := TIdEncode...

Problem with IdIPMCastClient Indy 10 Delphi 2009
Migrating an app from Delphi 2007 to Delphi 2009, I have run into a problem with IdIPMCastClient. Set Active to false raise exception 10049 cannot set address. Close the socket or reset socket you get either 10022 or 10038 If you disconnect and connect again by the 3rd time you will not receive any data. Having trouble updating to lastest dev snapshot. Any suggestions Regards Mike > {quote:title=Michael DuPree wrote:}{quote} > Migrating an app from Delphi 2007 to Delphi 2009, I have run into a problem with IdIPMCastClient. > Set Active to false raise exception 10049 cannot ...

Indy 10 install problem / Delphi 2006
I recently did a wipe-and-reinstall on my PC. I installed Delphi 2006 and now I am trying to install the newer version of Indy10 as the one that comes with the Delphi 2006 install has bugs. I followed the instructions I found here: http://www.indyproject.org/Sockets/Docs/Indy10Installation.EN.aspx and I downloaded the new version from here: http://indy.fulgan.com/ZIP/indy10.zip I unzipped the relevant directories into a new subdirectory I created under C:\Program Files\Borland\BDS\4.0\source\Indy10New\Lib When I began step 3, which says "Now open these .dpk files and click install...

Delphi 2009 and Indy 10 CharSet encoding problem
Hi guys, I'm sending some e-mails with my app, but the body text of my messages isnt displaying like expected ... example: I write some text with this characters ç ã é ó the text is changed to another char like "g". How can I fix that ? I've tryed to change the CharSet to Windows 1252 but nothing happened ... Any tips ? Regards, Diego Garcia -- Regards, Loki "Loki Man" <lokiman@hoknows.com> wrote in message news:51554@forums.codegear.com... > I've tryed to change the CharSet to Windows 1252 but noth...

Problem about Indy 10, IdTelnet component in Delphi 2009
Dear all: I make a simple test telnet program communicate with a linux server , through Idtelnet component , I specify the host property with a server ip, use a button to connect to the server . and display the welcome message in a memo . code as blew : procedure TForm1.Button1Click(Sender: TObject); begin Telnet.Connect; end; procedure TForm1.TelnetDataAvailable(Sender: TIdTelnet; const Buffer: string); begin Memo1.Lines.Add(Buffer); end; But when I click the button , the message displayed in the memo is like " }} }#}' ", not the normal...

Delphi 2009 / indy 10 html email unicode problem
I have updating an email application to delphi 2009 from delphi 2006. I now have the problem that html emails in in cyrrilic or greek are not send correctly. The code I used is: with IdMessage do begin clear; IsEncoded := true; Charset := 'utf-8'; ContentType :='multipart/alternative'; Encoding := meMime; UseNowForDate := true; Subject := MailSjabloon.Subject; From.Name := MailSjabloon.AfzenderNaam; From.Address ...

Delphi XE2 - Indy 10
Dear folks As result of security issues one of the email services in NZ has changed the settings of their email server. It used to be port 25 and outgoing mail was SMTP.xtra.co.nz. The port is now 465 and outgoing mail is now send.xtra.co.nz. The client configuration requires authentication and a secure connection (SSL). The result is that my code to connect for everyone using that provider is now "busted". I have changed the port and outgoing host accordingly. And have set the IOHandler of idSMTP as IdSSLIOHandlerSocketOpenSSL1. With the Authtype as satSASL. I have als...

Encoding issues with Delphi 2007 and Indy 10.5.5
Hi, I'm using the last snapshot of Indy 10 (Rev 3539) with Delphi 2007 under a French version of Windows Vista. I just discovered that some characters wasn't transferred correctly, probably since the Unicode update (AFAIK that worked fine with Indy 10.2.3). They are replaced by '?' on the other end of the connection. For instance, this code : procedure TForm2.Button1Click(Sender: TObject); begin IdTCPClient1.Connect; IdTCPClient1.IOHandler.WriteLn('£'); end; procedure TForm2.IdTCPServer1Execute(AContext: TIdContext); var S: string;...

HOW TO INSTALL Indy 10.5.7 in Delphi 2007 IDe from * Tiburon.zip * distribu
Date 25/05/2010 By Davide Spano e-mail davide.spano@armfield.co.uk ********************************************************************************** HOW TO INSTALL Indy 10.5.7 in Delphi 2007 IDe from * Tiburon.zip * distribution ********************************************************************************** - 0 What version of Indy I have in my IDE? To find out.. Create a new VCL project with a form and drag whatever of the components that are in the IDE Indy tool palette section (TIdTCPClient or other) then right click and select About Internet Dir...

Delphi 2007
Hi, I'm trying to install the latest build of Indy 10. I downloaded the following zip from "http://indy.fulgan.com/ZIP": *Monday, October 13, 2008 11:32 PM 6697544 indy10.zip* What I did with the zip: 1. I unzipped indy10.zip. 2. I removed my current Indy 10 from Delphi 2007 3. I opened Indy100Net.dpk and compiled it. I got the following 2 errors: [DCC Error] Indy100Net.dpk(4): E1030 Invalid compiler directive: 'ALIGN' [DCC Error] Indy100Net.dpk(30): E2202 Required package 'Borland.Delphi' not found package Indy100Net; {$R *.res} *{$...

Problem sending html e-mails with accents that have images with Indy 10.5.7 [Edit]
Hello, Every character that has an accent will not display when I send an html e-mail that contains pictures. It doesn't matter if it's an inline picture or if it's web-referenced: Any character that has an accent will display as a square. If I send an html e-mail that doesn't contain pictures, it usually (not always, I couldn't figure out the pattern yet) displays the accents properly. I tried both with design components and code-created components and setting character set to fr to the tidmessage as 'fr' but t he result is always the same. I'm using Del...

Web resources about - Indy E-Mail Problem (Indy 10, Delphi 2007) - embarcadero.delphi.winsock

Is–ought problem - Wikipedia, the free encyclopedia
The is–ought problem in meta-ethics as articulated by Scottish philosopher and historian David Hume (1711–76) is that many writers make claims ...

2016 BMW M3 and M4 recalled for driveshaft problem
... Recalls , Coupe , Sedan , Performance BMW will recall just 42 examples of the 2016 M3 and M4 in the US to check for a possible driveshaft problem. ...

Problem with metrics and referee directions
Vox has a brief little informer on the relative risk of injury in high school sports. I think it is useful, but reading the definition of injury ...

Trump: If GOP Does Not Stick to Our Deal ‘They’re Going to Have Problems’
Trump: If GOP Does Not Stick to Our Deal 'They're Going to Have Problems'

Microsoft has an emoji problem
Microsoft increasingly has an emoji problem as the company's Windows 10 operating system lacks the latest set of characters. Emoji are, essentially, ...

The junk problem is bigger than oil
Some have written off the high-yield concerns as a mere effect of crude oil's slide. But that analysis appears to be badly off base.

Social media addiction is a bigger problem than you think
Social networks are massively addictive. Most people I know check and interact on social sites constantly throughout the day. And they have no ...

3 and Out: Three big picture problems for the Patriots
... form Search 51° Main menu Home Celtics Patriots Red Sox Bruins Revolution More WRITERS Watch Shop NECN 3 and Out: Three big picture problems ...

Poll: Americans Have 99 Problems, And Terrorism Is No. 1
The number shot up from just 3 percent to 16 percent from November to December

Culture: The observer bias problem, and why you should care
... the same type of mistakes in drawing conclusions about what we observe with Islamic fundamentalism. As I wrote here , I believe that the problem ...

Resources last updated: 12/15/2015 9:02:34 PM