var tempstr1,tempstr2,saddre:string;relatedAttachmentList:TStrings;begintempstr1:='<html><body><p align=center>郵件內容,背景在HTML中指定地址寫本地址<img src=c:=aa.jpg>
</body></html>';tempstr2:=InlineParse(tempstr1);mesgMessage.Clear; if (relatedAttachmentList.Count>0) then begin with TIdText.Create(mesgMessage.MessageParts, nil) do begin Body.Text :=tempstr2; ContentType := 'text/html'; ParentPart := -1; ContentTransfer :='meMIME'; end; for i:=0 to relatedAttachmentList.Count-1 do with TIdAttachmentFile.Create(mesgMessage.MessageParts, relatedAttachmentList.Strings) do begin ContentID := '<'+CIDGet(relatedAttachmentList.Strings)+'>'; ContentType := 'image/*'; ContentDisposition := 'inline'; ParentPart := -1; end; mesgMessage.ContentType:='multipart/related; type="text/html"';end;