J'ai passé du temps a trouver d’où venait le bug de la date incorrecte dans l'envoi des mails anec TidSmtp V10 sous freepascal.

Voici une solution:

Modifier la section Uses pour ajouter unixutil
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
 
{$IFDEF UseBaseUnix}
      BaseUnix, Unix, Sockets, UnixType, unixutil ,
{$ENDIF}
Modifier la fonction DateTimeToGmtOffSetStr de IdGlobal.pas :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
function DateTimeToGmtOffSetStr(ADateTime: TDateTime; SubGMT: Boolean): string;
var
  AHour, AMin, ASec, AMSec: Word;
  {$IFDEF FPC}
    Absint : longint ;
  {$ENDIF}
begin
  if (ADateTime = 0.0) and SubGMT then
  begin
    Result := 'GMT'; {do not localize}
    Exit;
  end;
{$IFDEF WIN32_OR_WIN64_OR_WINCE}
  DecodeTime(ADateTime, AHour, AMin, ASec, AMSec);
  Result := IndyFormat(' %0.2d%0.2d', [AHour, AMin]); {do not localize}
  if ADateTime < 0.0 then begin
    Result[1] := '-'; {do not localize}
  end else begin
    Result[1] := '+';  {do not localize}
  end;
{$ELSE}
     {$IFDEF FPC}
     // concerne Freepascal 
         AbsInt := ABS(Tzseconds);
         AHour := AbsInt DIV  3600;
         AMin  := (AbsInt MOD  3600) DIV 60;
         Result := IndyFormat(' %0.2d%0.2d', [AHour, AMin]);
         if  Tzseconds < 0.0 then begin
            Result[1] := '-'; {do not localize}
         end else begin
            Result[1] := '+';  {do not localize}
         end;
      {$ENDIF}
{$ENDIF}
end;

Bon dev tous ...

kypton68