Lose BCC info when save to stream?

Giganews Newsgroups
Subject: Lose BCC info when save to stream?
Posted by:  Dan (onsi…@hpassist.com)
Date: Fri, 19 Jan 2007

Hi all,
Not sure if this is the best news group for this.  In one of my programs I
create a TidMessage, set the body, etc, including the BCCList.  I save the
IdMessage to a stream, save in a blob field.  Later, when I want to send the
email, I read the stream from the field, then load into a TidMessage from
stream.  All of the info is correct including attachment, recipients,
CCList, except BCCList is empty, where it wasn't before I saved it to the
stream.  Is this a bug?
Indy 10.0.52
D7

How to re-create:
procedure Tform1.bcctestClick(Sender: TObject);
  var zEmailStream:TMemoryStream;
      zNotifyMsg:TIdMessage;
begin
  zNotifyMsg:=TIdMessage.Create;
  zNotifyMsg.BccList.EMailAddresses:='a…@test.com';
  zNotifyMsg.CCList.EMailAddresses:='e…@test.com';
  ShowMessage('Before stream'
    +#13+#10+'BCC= '+zNotifyMsg.BccList.EMailAddresses
    +#13+#10+'CC= '+zNotifyMsg.CCList.EMailAddresses);
  zEmailStream:=TMemoryStream.Create;
  zNotifyMsg.SaveToStream(zEmailStream);
  zEmailStream.Position:=0;
  zNotifyMsg.Free;
  zNotifyMsg:=TIdMessage.Create;
  zNotifyMsg.LoadFromStream(zEmailStream);
  ShowMessage('After stream'
    +#13+#10+'BCC= '+zNotifyMsg.BccList.EMailAddresses
    +#13+#10+'CC= '+zNotifyMsg.CCList.EMailAddresses);
  zNotifyMsg.Free;
  zEmailStream.Free;
end;

Replies