Re: TIdMessage exception on header parsing

Giganews Newsgroups
Subject: Re: TIdMessage exception on header parsing
Posted by:  Ciaran Costelloe (ccostell…@flogas.ie)
Date: Mon, 17 Jan 2005

"Andy" <info@no_spamszybkieczytanie.net> wrote in message
news:7F07B6E3B4BBE240info@no_spamszybkieczytanie.net...
> Hi,
>
> I wanted to do the following:
>
>        TIdMessage *Msg = new TIdMessage(NULL);
>        Msg->LoadFromFile("message.eml");
>
> But there was an exception. After a few tries I found out that this is
> causing the problem:
>
>  Subject:
> =?iso-8859-2?Q?RE:_Kupi=B3e=B6_przedmiot_poprzez_Kup_Teraz_-_nr_aukcji:_3?=
>  =?iso-8859-2?Q?8766819_?=
>
> Chaning it to the following resolves the problem:
>
>  Subject:
> =?iso-8859-2?Q?RE:_Kupi=B3e=B6_przedmiot_poprzez_Kup_Teraz_-_nr_aukcji:_38766819_?=
>
> But the bad news is I can't change it on a remote server.
> What should I do? :)

You must wrap your code in try/except blocks.  You are guaranteed to receive
malformed emails, Invariably spam, these days.

Ciaran

Replies

In response to

TIdMessage exception on header parsing posted by Andy on Thu, 13 Jan 2005