Advertisement
RandomClear

How to send arbitraty e-mail - method #2

Feb 11th, 2013
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.54 KB | None | 0 0
  1. // See also: http://pastebin.com/BBuTp8Kq - "how to send arbitraty e-mail - method #1"
  2. // See also: http://pastebin.com/BR5iyxkW - "how to send arbitraty e-mail - method #3"
  3. // See also: http://pastebin.com/M5D57Naa - "how to send arbitraty e-mail - method #4"
  4. // See also: http://pastebin.com/MfLi4pbj - "how to send arbitrary e-mail with file attaches"
  5. // See also: http://pastebin.com/3Q1ykdSH - "how to send feedback instead of bug report"
  6. // See also: http://pastebin.com/jxKB2WDZ - "how to send arbitrary data to bug tracker"
  7.  
  8. // This code will work in any project - even without EurekaLog active
  9.  
  10. // This is most reliable e-mail send method.
  11. // It works exactly as your typical e-mail client application (Outlook, The Bat, Mozilla Thunderbird, etc.).
  12. // It also requires you to store/provide your credentials (login/password).
  13.  
  14. uses
  15.   ETypes, ESendMail, ESendMailSMTP;
  16.  
  17. procedure TForm1.Button1Click(Sender: TObject);
  18. begin
  19.   // Plain SMTP:
  20.   EurekaLogSendEmail(esmSMTPClient, 'from-email@example.com', 'to-email@example.com', 'Subject', 'Body', 'smtp.server.com', 'from-email', 'password', 25 { SMTP port });
  21.  
  22.   // SSL:
  23.   EurekaLogSendEmail(esmSMTPClient, 'from-email@example.com', 'to-email@example.com', 'Subject', 'Body', 'smtp.server.com', 'from-email', 'password', 465 { SMTP SSL port }, nil, nil, nil, ctSSL);
  24.  
  25.   // TLS:
  26.   EurekaLogSendEmail(esmSMTPClient, 'from-email@example.com', 'to-email@example.com', 'Subject', 'Body', 'smtp.server.com', 'from-email', 'password', 587 { SMTP TLS port, could be also 25 }, nil, nil, nil, ctTLS);
  27. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement