(1)ADOQAF:TADOQUERY    MSG:TMAILMESSAGE200
(2)把邮件保存到数据库(ACCESS数据库)
(3)问题:为什么收下来后附件文件全是0字节的?
if Msg.AttachList.Count>0 then          //保存附件,并将相应信息读入afp table
begin
adoqAF.Close;
adoqAF.SQL.Clear;
adoqAF.SQL.Text:='select * from AFP';
adoqAF.Open;
for Loop := 0 to Msg.AttachList.Count-1 do
beginpath:=ExtractFilePath(ParamStr(0))+'AFP\'+Msg.AttachList[loop].FileName;
                                                        temp2:=TMemoryStream.Create;
 Msg.AttachList[loop].Decoded.SaveToStream(temp2); 
temp2.Position:=0;
temp2.SaveToFile(path);
temp2.Free; 
adoqAF.Edit;
adoqAF.Insert;
adoqAF.FieldByName('User_no').AsString:=User_no;
adoqAF.FieldByName('MsgID').AsString:=Msg.MessageId;
adoqAF.FieldByName('AFP').AsString:=Msg.AttachList[loop].FileName; //只显示附件名
adoqAF.Post;