IDMessage1.Subject := ...//主题
IDMessage1.Recipients.EMailAddresses := ... //收件人
IDMessage1.CCList.EMailAddresses := ... //抄送
IDMessage1.BccList.EMailAddresses := ... // 副本
IDMessage1.From.Address := ... //发件人
IDMessage1.Body.Clear;
IDMessage1.Body.Assign(Memo1.Lines); //邮件正文
for i := 0 to ListBox1.Count - 1 do
TIdAttachment.Create(IDMessage1.MessageParts,ListBox1.Items[i]); //附件
IDSMTP1.Send(IDMessage1);