Advertisement
RandomClear

How to setup send method from code

Feb 13th, 2013
549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.75 KB | None | 0 0
  1. // See also: http://pastebin.com/MfLi4pbj - "how to send arbitrary e-mail with file attaches"
  2. // See also: http://pastebin.com/3Q1ykdSH - "how to send feedback instead of bug report"
  3. // See also: http://pastebin.com/jxKB2WDZ - "how to send arbitrary data to bug tracker"
  4.  
  5. uses
  6.   ETypes, ESend, ExceptionLog7,
  7.   // Be sure that code for send method is included somewhere:
  8.   ESendAPIMantis, ESendMailSMTP;
  9.  
  10. procedure TForm1.FormCreate(Sender: TObject);
  11. begin
  12.   // Delete any configured send method
  13.   CurrentEurekaLogOptions.SenderClasses := wsmNoSend;
  14.  
  15.   // Add two new send methods
  16.   CurrentEurekaLogOptions.AddSenderClass(wsmMantis);
  17.   CurrentEurekaLogOptions.AddSenderClass(esmSMTPClient);
  18.  
  19.   // Configure first send method
  20.   CurrentEurekaLogOptions.SendMantisURL := 'bugs.example.com';
  21.   CurrentEurekaLogOptions.SendMantisPort := 80;
  22.   CurrentEurekaLogOptions.SendMantisSSL := False;
  23.   CurrentEurekaLogOptions.SendMantisLogin := 'account';
  24.   CurrentEurekaLogOptions.SendMantisPassword := 'password';
  25.   CurrentEurekaLogOptions.SendMantisProject := 'ProjectName';
  26.   CurrentEurekaLogOptions.SendMantisCategory := 'CategoryName';
  27.   CurrentEurekaLogOptions.SendMantisOwner := 'AssignToAccount';
  28.   // ...
  29.  
  30.   // Configure second send method
  31.   CurrentEurekaLogOptions.SendSMTPClientHost := 'smtp.example.com';
  32.   CurrentEurekaLogOptions.SendSMTPClientPort := 25;
  33.   CurrentEurekaLogOptions.SendSMTPClientLogin := 'bugs@example.com';
  34.   CurrentEurekaLogOptions.SendSMTPClientFrom := 'bugs@example.com';
  35.   CurrentEurekaLogOptions.SendSMTPClientPassword := 'password';
  36.   CurrentEurekaLogOptions.SendSMTPClientTarget := 'bugs@example.com';
  37.   CurrentEurekaLogOptions.SendSMTPClientSubject := 'Subject';
  38.   CurrentEurekaLogOptions.SendSMTPClientMessage := '';
  39.   // ...
  40. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement