SYNAPSE - Synchronous TCP/IP Library for Delphi
Other related information can be found at http://www.ararat.cz/synapse/
Class: TSMTPSend
- Properties:
- Timeout:integer
Define timeout in milliseconds for all SMTP operations. Default value is 300 seconds.
- SMTPhost:String
Address of SMTP server (IP address or domain name) where you want to connect.
- ResultCode:integer
result code of last SMTP command.
- ResultString:string
result string of last SMTP command (begin with string representation of result code).
- Methods:
- Function Login:Boolean
Connects to SMTP server (defined inSMTPhost) and begin SMTP session. (HELO handshake). If all OK, result is true, else result is false.
- Procedure Logout
Close SMTP session (QUIT command) and disconnect from SMTP server.
- Function Reset:Boolean
Send RSET SMTP command for reset SMTP session. If all OK, result is true, else result is false.
- Function Noop:Boolean
Send NOOP SMTP command for keep SMTP session. If all OK, result is true, else result is false.
- Function mailfrom(Value:string):Boolean
Send MAIL FROM SMTP command for set sender e-mail address. If senders e-mail address is empty string, transmited message is error message. If all OK, result is true, else result is false.
- Function mailto(Value:string):Boolean
Send RCPT TO SMTP command for set receiver e-mail address. It cannot be an empty string. If all OK, result is true, else result is false.
- Function maildata(Value:Tstrings):Boolean
Send DATA SMTP command and transmit message data. If all OK, result is true, else result is false.
- Not class (but cohere) functions:
- Function Sendto (mailfrom,mailto,subject,SMTPHost:string;maildata:TStrings):Boolean
Usefull sample of using TSMTPsend object. Send maildata (text of e-mail without any SMTP headers!) from mailfrom e-mail address to mailto e-mail address (It can be only ONE e-mail address, multiple receivers not supported!) with subject. Function construct all needed SMTP headers (with DATE header) and send e-mail to SMTP server defined in SMTPhost parameter. If e-mail message successfully sended, then result is true.
- Function SendtoRaw (mailfrom,mailto,SMTPHost:string;maildata:TStrings):Boolean
Usefull sample of using TSMTPsend object. Send maildata (text of e-mail with SMTP headers!) from mailfrom e-mail address to mailto e-mail address (It can be only ONE e-mail address, multiple receivers not supported!). Function send e-mail to SMTP server defined in SMTPhost parameter. If e-mail message successfully sended, then result is true.