1234567891011121314151617181920212223242526272829303132 |
- program SendEmail;
- {$APPTYPE CONSOLE}
- {$R *.res}
- uses
- System.SysUtils,
- Quick.Console,
- Quick.SMTP;
- var
- smtp : TSMTP;
- begin
- try
- smtp := TSMTP.Create('mail.mydomain.com',25,True);
- smtp.Username := '[email protected]';
- smtp.Password := '1234';
- smtp.SendEmail('[email protected]',
- 'Test email',
- 'A test message',
- '[email protected]',
- '[email protected]',
- '[email protected]',
- 'This is the body message');
- cout('Press <ENTER> to Exit',ccYellow);
- ConsoleWaitForEnterKey;
- except
- on E: Exception do
- Writeln(E.ClassName, ': ', E.Message);
- end;
- end.
|