How to pass email datetime to the New TIdImap4.AppendMsg method? - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Indy (https://www.atozed.com/forums/forum-8.html) +--- Forum: Indy General Discussion (https://www.atozed.com/forums/forum-9.html) +--- Thread: How to pass email datetime to the New TIdImap4.AppendMsg method? (/thread-165.html) |
How to pass email datetime to the New TIdImap4.AppendMsg method? - edwinyzh - 05-10-2018 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. RE: How to pass email datetime to the New TIdImap4.AppendMsg method? - rlebeau - 05-10-2018 (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 = []; (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. RE: How to pass email datetime to the New TIdImap4.AppendMsg method? - edwinyzh - 05-11-2018 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 RE: How to pass email datetime to the New TIdImap4.AppendMsg method? - rlebeau - 05-11-2018 (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. |