How can I send whole StringList via attachment through Email without saving to the harddrive? I am aware of attachment limits..
5
votes
3 Answers
5
votes
You can use TIdAttachmentMemory instead of TIdAttachmentFile :
StringList := TStringList.Create;
StringList.Append('foo');
StringList.Append('bar');
MemoryStream := TMemoryStream.Create;
StringList.SaveToStream(MemoryStream);
MemoryStream.Position := 0;
IdMessage := TIdMessage.Create(nil);
IdAttachmentMemory := TIdAttachmentMemory.Create(IdMessage.MessageParts,MemoryStream);
2
votes