Re: Problem with French and Spanish Characters with TIdMessage

Giganews Newsgroups
Subject: Re: Problem with French and Spanish Characters with TIdMessage
Posted by:  Louis Valmeras (valmlou…@hotmail.com)
Date: Tue, 7 Jun 2011

I forgot to say that I am using Indy 10.5.7
-----------------------------

> I am sending emails, through a gmail account, using TIdSMTP and TIdMessage c
> omponents using SSL with Intraweb and RAD Studio XE (C++ builder).
> The messages contain embedded pictures.
> When the message is in english there is not problem. But with messages with
> French or Spanish characters, the message is delivered like below:
>
> ? Chers utilisateurs,
> Nous avons le plaisir de vous informer d'importants changements ?honissa.com
> :
> 1 - Au niveau de la s?rite: toujours soucieux de proteger les informations d
> e nos utilisateurs, nous avons rajouter une option de s?rite suppl?ntaire. T
> out acces a votre compte ? Ehonissa.com, generera automatiquement un courrie
> l qui vous sera envoye. Ainsi si vous n'etes pas l'auteur de cet acces, vous
>  pourrez aussitot nous avisez pour que nous prenions les mesures necessaires
> . ?
>
> Below are part of the html code and C++ Builder code:
>
> ? <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> <title>Untitled Document</title>
> <style type="text/css">
> body,td,th {
>     color: #00F;
> }
> h1 {
>     font-size: 14px;
>     color: #30F;
> }
> h1,h2,h3,h4,h5,h6 {
>     font-family: "Times New Roman", Times, serif;
> }
> </style>
> </head>
>
> <body>
> <table width="895" height="376" border="1">
>  <tr>
>    <td width="175"><img src="../AdminPicture.jpg" alt="AdminPicture" name="
> AdminPicture" width="172" height="166" align="left" id="AdminPicture" /></td
> > ?
>
> C++ builder code
>
> TIdAttachmentFile *Photo;
> TIdText *TexteHTML, *TexteBrut;
> AnsiString Directory = ExtractFilePath(Application->ExeName);
>
> TIWText *TexteMessage = new TIWText(NULL);
> TJPEGImage *MailPicture = new TJPEGImage();
>
> ...........
>
> TIdMessage->Subject = Subject;
> TIdMessage->ContentType = "multipart/related";
> TIdMessage->Recipients->EMailAddresses = MessageRecipient;
>
> TexteBrut = new TIdText(AlertEmail->MessageParts, NULL);
> TexteBrut->ContentType = "text/plain";
> TexteBrut->Body->Text = " ";
>
> TexteHTML = new TIdText(AlertEmail->MessageParts, TexteMessage->Lines);
> TexteHTML->ContentType = "text/html";
>
> MailPicture->SaveToFile(PictureName + ".jpg");
>
> -----------------------------------------------
> I though that it was related to the charset utf-8 in the html code. But even
>  if I replace it with ISO-8859-1, the result is the same.
> What can be the problem?

Replies

None

In response to

Problem with French and Spanish Characters with TIdMessage posted by Louis Valmeras on Mon, 6 Jun 2011