Settings_SmtpAgent.pas
上传用户:dh8233980
上传日期:2014-10-16
资源大小:1015k
文件大小:3k
源码类别:

Email服务器

开发平台:

Delphi

  1. unit Settings_SmtpAgent;
  2. (******************************************************************************)
  3. (*                                                                            *)
  4. (* Hermes Smtp Agent Settings Dialog Box                                      *)
  5. (* Part of Hermes SMTP/POP3 Server.                                           *)
  6. (* Copyright(C) 2000 by Alexander J. Fanti, All Rights Reserver Worldwide.    *)
  7. (*                                                                            *)
  8. (* Created January 17, 2000 by Alexander J. Fanti.  See License.txt           *)
  9. (*                                                                            *)
  10. (* Used by: Main                                                              *)
  11. (* Uses: DataU1                                                               *)
  12. (*                                                                            *)
  13. (* Description: This Modal dialog window allows the user to change the        *)
  14. (*              Smtp Agent settings                                           *)
  15. (*                                                                            *)
  16. (* Revisions: 1/21/2000  AJF  Commented                                       *)
  17. (*                                                                            *)
  18. (******************************************************************************)
  19. interface
  20. uses
  21.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  22.   StdCtrls, Buttons, Spin, ComCtrls;
  23. type
  24.   TfrmSettings_SmtpAgent = class(TForm)
  25.     btnCancel: TBitBtn;
  26.     btnOK: TBitBtn;
  27.     PageControl1: TPageControl;
  28.     tsQueue: TTabSheet;
  29.     tsRetry: TTabSheet;
  30.     Label1: TLabel;
  31.     speInterval: TSpinEdit;
  32.     Label5: TLabel;
  33.     Label2: TLabel;
  34.     speRetry: TSpinEdit;
  35.     cbxBypassQueue: TCheckBox;
  36.     Label3: TLabel;
  37.     txtMasterSMTPServer: TEdit;
  38.     cbxForwardToMasterSMTPServer: TCheckBox;
  39.     speInactivityTimeout: TSpinEdit;
  40.     lblConnectionInactivityTimeout: TLabel;
  41.     procedure FormShow(Sender: TObject);
  42.     procedure btnOKClick(Sender: TObject);
  43.   private
  44.     { Private declarations }
  45.   public
  46.     { Public declarations }
  47.   end;
  48. var
  49.   frmSettings_SmtpAgent: TfrmSettings_SmtpAgent;
  50. implementation
  51. uses DataU1;
  52. {$R *.DFM}
  53. procedure TfrmSettings_SmtpAgent.FormShow(Sender: TObject);
  54. begin
  55.   PageControl1.ActivePage := tsQueue;
  56.   // Populate Dialog with Setting Information
  57.   speInterval.Value := (INI.Agent_PollingInterval div 60);
  58.   speRetry.Value := INI.Smtp_Retries;
  59.   cbxBypassQueue.Checked := INI.Agent_ServiceQueueImmediately;
  60.   cbxForwardToMasterSMTPServer.Checked := INI.Agent_ForwardToMasterSMTP;
  61.   txtMasterSMTPServer.Text := INI.Agent_MasterServerIPAddress;
  62.   speInactivityTimeout.Value := INI.Agent_InactivityTimeout;
  63. end;
  64. procedure TfrmSettings_SmtpAgent.btnOKClick(Sender: TObject);
  65. begin
  66.   // Retrieve Settings from Dialog
  67.   INI.Agent_PollingInterval := (speInterval.Value * 60);
  68.   INI.Smtp_Retries := speRetry.Value;
  69.   INI.Agent_ServiceQueueImmediately := cbxBypassQueue.Checked;
  70.   INI.Agent_ForwardToMasterSMTP := cbxForwardToMasterSMTPServer.Checked;
  71.   INI.Agent_MasterServerIPAddress := txtMasterSMTPServer.Text;
  72.   INI.Agent_InactivityTimeout := speInactivityTimeout.Value;
  73. end;
  74. end.