如何通过电子邮件通过附件发送整个 StringList 而不保存到硬盘?我知道附件限制..
最佳答案
您可以使用 TIdAttachmentMemory 代替 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);
关于delphi - 通过电子邮件将 StringList 作为附件发送 - Indy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13701752/