TIdMessage Timestamp

Giganews Newsgroups
Subject: TIdMessage Timestamp
Posted by:  Steve Caupp (scau…@mfm.com)
Date: Mon, 10 Jan 2005

I'm using Indy (what ever version shipped with K2) under Kylix 2 to e-mail
our support group when certain things happen in our web server.  This all
works like a champ (of course) but I've got one little problem.

E-mail messages all arrive time stamped with UTC time.  I've tried changing
both IdMessage.Date and IdMessage.Headers thus:

        msg := TIdMessage.Create(SMTP);
        msg.Subject := sSubject;
        msg.Recipients.EMailAddresses := sAddress;
        msg.From.Text := sFrom;
        msg.Body.Text := sMsg;
        msg.Date := dtNow;
        msg.Headers.Values['Date'] := DateTimeToStr(dtNow);
        smtp.Host := sHost;
        smtp.Connect;
        try;
          smtp.Send(msg);
        finally
          msg.Free;
          smtp.Disconnect;
        end;

but all e-mail messages continue to arrive with a UTC timestamp.  I'm sure
I'm missing something extremely simple, but I can't spot it.

Any suggestions?

Replies