2
20026012
Unregistered / Unconfirmed
GUEST, unregistred user!
for J:=0 to IdMessage1.MessageParts.Count-1 do
begin
if (IdMessage1.MessageParts.Items[J] is TIdAttachment) then
//附件信息
begin
K:=Listview2.Items.Add;
K.Caption:=TIdAttachment(IdMessage1.MessageParts.Items[J]).Filename;
K.SubItems.Add(TIdAttachment(IdMessage1.MessageParts.Items[J]).ContentType);
fn:=TIdAttachment(IdMessage1.MessageParts.Items[J]).Filename;
li:=TIdAttachment(IdMessage1.MessageParts.Items[J]).ContentType;
ADOQuery1.close;
ADOQuery1.SQL.Clear;
ADOQuery1.Parameters.Clear;
ADOQuery1.SQL.Add('insert into f3');
ADOQuery1.SQL.Add('(附件名,/附件内容/附件路径) values 附件名,附件内容/附件路径)');
ADOQuery1.parameters[5].value:=fn;
ADOQuery1.parameters[6].value:=li;
end
else
begin
if IdMessage1.MessageParts.Items[J] is TIdText then
begin
Memo1.Lines.Clear;
Memo1.Lines.AddStrings(TIdText(IdMessage1.MessageParts.Items[J]).Body);
by:=TIdText(IdMessage1.MessageParts.Items[J]).Body;
ADOQuery1.close;
ADOQuery1.SQL.Clear;
ADOQuery1.Parameters.Clear;
ADOQuery1.SQL.Add('insert into f3');
ADOQuery1.SQL.Add('(邮件内容) values 邮件内容)');
ADOQuery1.parameters[7].value:=by.CommaText;
end;
end;
end;
用这几行代码 实现不了邮件内容的插入.有错误 我不知道怎么把邮件内容和附件名等插入到Access中.请各位仁兄帮帮小女子
begin
if (IdMessage1.MessageParts.Items[J] is TIdAttachment) then
//附件信息
begin
K:=Listview2.Items.Add;
K.Caption:=TIdAttachment(IdMessage1.MessageParts.Items[J]).Filename;
K.SubItems.Add(TIdAttachment(IdMessage1.MessageParts.Items[J]).ContentType);
fn:=TIdAttachment(IdMessage1.MessageParts.Items[J]).Filename;
li:=TIdAttachment(IdMessage1.MessageParts.Items[J]).ContentType;
ADOQuery1.close;
ADOQuery1.SQL.Clear;
ADOQuery1.Parameters.Clear;
ADOQuery1.SQL.Add('insert into f3');
ADOQuery1.SQL.Add('(附件名,/附件内容/附件路径) values 附件名,附件内容/附件路径)');
ADOQuery1.parameters[5].value:=fn;
ADOQuery1.parameters[6].value:=li;
end
else
begin
if IdMessage1.MessageParts.Items[J] is TIdText then
begin
Memo1.Lines.Clear;
Memo1.Lines.AddStrings(TIdText(IdMessage1.MessageParts.Items[J]).Body);
by:=TIdText(IdMessage1.MessageParts.Items[J]).Body;
ADOQuery1.close;
ADOQuery1.SQL.Clear;
ADOQuery1.Parameters.Clear;
ADOQuery1.SQL.Add('insert into f3');
ADOQuery1.SQL.Add('(邮件内容) values 邮件内容)');
ADOQuery1.parameters[7].value:=by.CommaText;
end;
end;
end;
用这几行代码 实现不了邮件内容的插入.有错误 我不知道怎么把邮件内容和附件名等插入到Access中.请各位仁兄帮帮小女子