Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to pass email datetime to the New TIdImap4.AppendMsg method?
#1
Hello,

In the old version of Indy 10 (a few years back), the TIdImap4.AppendMsg allows  me to pass the UTC datetime of the email, but I don't know since when the parameter list of that method has changed.

I have noticed the AAlternativeHeaders: TIdHeaderList parameter, I guess I can set the email date using this parameter? If yes, how? Thanks.
Reply
#2
(05-10-2018, 08:44 AM)edwinyzh Wrote: In the old version of Indy 10 (a few years back), the TIdImap4.AppendMsg allows  me to pass the UTC datetime of the email, but I don't know since when the parameter list of that method has changed.

In the current version (10.6.2.5457), all of the TIdIMAP4.AppendMsg...() overloaded methods still have an optional AInternalDateTimeGMT parameter:

Code:
function  AppendMsg(const AMBName: String; AMsg: TIdMessage; const AFlags: TIdMessageFlagsSet = [];
     const AInternalDateTimeGMT: TDateTime = 0.0): Boolean; overload;

function  AppendMsg(const AMBName: String; AMsg: TIdMessage; AAlternativeHeaders: TIdHeaderList;
     const AFlags: TIdMessageFlagsSet = []; const AInternalDateTimeGMT: TDateTime = 0.0): Boolean; overload;

function  AppendMsgNoEncodeFromFile(const AMBName: String; ASourceFile: string; const AFlags: TIdMessageFlagsSet = [];
     const AInternalDateTimeGMT: TDateTime = 0.0): Boolean;

function  AppendMsgNoEncodeFromStream(const AMBName: String; AStream: TStream; const AFlags: TIdMessageFlagsSet = [];
     const AInternalDateTimeGMT: TDateTime = 0.0): Boolean;

(05-10-2018, 08:44 AM)edwinyzh Wrote: I have noticed the AAlternativeHeaders: TIdHeaderList parameter, I guess I can set the email date using this parameter?

Actually no, you cannot.  The AAlternativeHeaders parameter simply allows you to provide a different set of email headers, instead of using the TIdMessage.Headers or TIdMessage.LastGeneratedHeaders normally.  But, that is just arbitrary email data from IMAP's perspective.  The actual date of the message envelope that will contain the final email data will be the current date/time, unless you specify a non-zero value for the AInternalDateTimeGMT parameter.

Reply
#3
Oh I'm sorry, it's my mistake.

I had a system crash, reinstalled the OS and delphi, trying to get everything up but forgot the install the latest indy 10 svn repository.

Sorry.

ps, I found that the Indy repository have Fullc_XE?.bat (for c++ builder?) but don't have FullD_XE?.bat for Delphi...

PS 2, I found this info is helpful for installing the latest indy from the svn repository:
https://stackoverflow.com/a/486276/133516
Reply
#4
(05-11-2018, 08:54 AM)edwinyzh Wrote: ps, I found that the Indy repository have Fullc_XE?.bat (for c++ builder?) but don't have FullD_XE?.bat for Delphi...

Correct, because Indy does not require command-line compiling for Delphi. Just open the packages in the IDE, compile, and Install. Installation for C++Builder takes a few extra steps to compile the files, so that is done using command-line scripts instead.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)