发送邮件怎么设置了content-id后就看不到附件了啊????
特兰 2008-06-09 02:37:04 TxtPart:=TIdText.Create(IdMessage.MessageParts);
TxtPart.ContentType := 'text/plain';
TxtPart.Body.Text := '';
HtmlPart:=TIdText.Create(IdMessage.MessageParts,MailBody);
HtmlPart.ContentType:= 'text/html';
for i:=0 to AttachList.Count-1 do
begin
Abc:=TidAttachment.Create(IdMessage.MessageParts,AttachList.Strings[i]);
//Abc.ExtraHeaders.Values['content-id']:='XlsAttch'+IntToStr(i);
//如果在这里或者下面加入这段代码发送的邮件就看不到附件了
//Abc.ContentDisposition:='attachment';
end;
//以下是發送圖片附件併在郵件中html通過 cid:IMG1 來顯示
Abc:=TidAttachment.Create(IdMessage.MessageParts,Directory+'Report.jpg');
Abc.ContentType:='image/jpeg';
//Abc.ContentDisposition:='inline';
Abc.ExtraHeaders.Values['content-id']:='IMG1';