开发工具:
文件大小: 633kb
下载次数: 0
上传时间: 2012-06-07
详细说明: var currentMsg: integer; procedure TForm1.CntClick(Sender: TObject); begin SakPOP1.Host := EditHost.text; SakPOP1.UserId := EditUserId.text; SakPOP1.UserPasswd := EditPasswd.text; StatusBar1.Panels[0].text := 'Wait a moment, please...'; SakPOP1.connect; if SakPOP1.POPError then begin MessageDlg( 'Connect failed. Maybe the server is down or not responding.', mtError, [mbOk], 0); exit; end; if not SakPOP1.login then begin ShowMessa ge('Unauthorized access...'); exit; end; SakPOP1.Init; showMessage( 'You have ' + intToStr( SakPOP1.MsgsCount) + ' new msg(s) '); BtnCancel.Enabled := true; sakPOP1.retrieveAllMessages( SakMsgList1); BtnCancel.Enabled := false; SakPOP1.Disconnect; if SakMsgList1.count > 0 then begin currentMsg := 0; showCurrentMsg; end; StatusBar1.Panels[0].text := 'Done. ' + intToStr( SakMsgList1.count) + ' msgs retrieved.'; end; procedure TForm1.ButtonPriorClick(Sender: TObject); begin if currentMsg > 0 then begin dec( currentMsg); showCurrentMsg; end; end; procedure TForm1.ButtonNextClick(Sender: TObject); begin if currentMsg < SakMsgList1.count-1 then begin inc( currentMsg); showCurrentMsg; end; end; procedure TForm1.showCurrentMsg; var msg: TSakMsg; i: integer; begin msg := SakMsgList1.items[ currentMsg]; labelMsgId.Caption := msg.MessageId; labelInReplyTo.Caption := msg.InReplyTo; labelFrom.caption := msg.From; labelTo.caption := msg.SendTo; labelSubject.caption := msg.Subject; labelDate.caption := msg.Date; labelReplyTo.Caption := msg.ReplyTo; labelReturnPath.Caption := msg.ReturnPath; labelContentType.Caption := msg.ContentType; LabelEncoding.Caption := msg.ContentTransferEncoding; LabelSender.Caption := msg.Sender; LabelCC.Caption := msg.CC; memo1.text := msg.Text.Text; {msg.Text is a StringList} if msg.AttachedFiles.Count > 0 then begin comboBoxAttach.items.clear; for i := 0 to msg.AttachedFiles.Count-1 do comboBoxAttach.items.add( msg.AttachedFiles[ i].fileName); comboBoxAttach.enabled := true; comboBoxAttach.itemIndex := 0; buttonSave.enabled := true; end else begin comboBoxAttach.enabled := false; buttonSave.enabled := false; end; end; procedure TForm1.ButtonSaveClick(Sender: TObject); begin saveDialog1.FileName := comboBoxAttach.text; if saveDialog1.execute then SakMsgList1[ currentMsg].AttachedFiles[ comboBoxAttach.itemIndex].saveToFile( saveDialog1.FileName); end; procedure TForm1.SakPOP1AfterRetrieve(Sender: TObject); begin StatusBar1.Panels[0].text := 'Retrieving... ' + intToStr( SakMsgList1.count) + ' msg(s) retrieved'; end; procedure TForm1.SakPOP1DecodeProgress(Sender: TObject; Percent: Word); begin // ProgressBar1.Position := Percent; end; procedure TForm1.SakPOP1DecodeStart(Sender: TObject; FileName: String; BytesCount: Integer); begin // ProgressBar1.Position := 0; end; procedure TForm1.SakPOP1RetrieveProgress(Sender: TObject; Percent: Word); begin ProgressBar2.Position := Percent; end; procedure TForm1.SakPOP1Error(Sender: TObject; Error: Integer; Msg: String); begin ShowMessage( Msg); end; procedure TForm1.SakPOP1BeforeRetrieve(sender: TObject; id: Word); begin ProgressBar2.Position := 0; end; ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.