Difference between revisions of "Unit SMTP"
From Ultibo.org
(9 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | '' | + | '''Ultibo SMTP Interface unit''' |
=== Constants === | === Constants === | ||
Line 28: | Line 28: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''SMTP status | + | <div style="font-size: 14px; padding-left: 12px;">'''SMTP status''' <code> SMTP_STATUS_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 65: | Line 65: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''SMTP command | + | <div style="font-size: 14px; padding-left: 12px;">'''SMTP command''' <code> SMTP_COMMAND_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 109: | Line 109: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''SMTP sub command | + | <div style="font-size: 14px; padding-left: 12px;">'''SMTP sub command''' <code> SMTP_SUB_COMMAND_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 123: | Line 123: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''SMTP string | + | <div style="font-size: 14px; padding-left: 12px;">'''SMTP string''' <code> SMTP_STRING_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 292: | Line 292: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''SMTP logging | + | <div style="font-size: 14px; padding-left: 12px;">'''SMTP logging''' <code> SMTP_LOG_* </code></div> |
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
Line 301: | Line 301: | ||
| <code>SMTP_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code> | | <code>SMTP_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code> | ||
| SMTP informational messages | | SMTP informational messages | ||
+ | |- | ||
+ | | <code>SMTP_LOG_LEVEL_WARN = LOG_LEVEL_WARN;</code> | ||
+ | | SMTP warning messages | ||
|- | |- | ||
| <code>SMTP_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code> | | <code>SMTP_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code> | ||
Line 315: | Line 318: | ||
---- | ---- | ||
− | '' | + | |
+ | '''SMTP client notify event''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSMTPClientNotifyEvent = procedure(const ARequest:String) of Object;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''SMTP host event''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSMTPHostEvent = function(AConnection:TSMTPConnection):Boolean of Object;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''SMTP count event''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSMTPCountEvent = function(AConnection:TSMTPConnection):Boolean of Object;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''SMTP notify event''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSMTPNotifyEvent = procedure(AConnection:TSMTPConnection; const ARequest:String) of Object;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''SMTP request event''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSMTPRequestEvent = function(AConnection:TSMTPConnection; const ARequest:String; var AReply:String):Boolean of Object;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''SMTP authenticate event''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSMTPAuthenticateEvent = function(AConnection:TSMTPConnection; const AMethod,AUsername,APassword:String; var AReply:String):Boolean of Object;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''SMTP connection event''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>TSMTPConnectionEvent = procedure(AConnection:TSMTPConnection) of Object; </code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | <br /> | ||
+ | |||
+ | === Class definitions === | ||
+ | ---- | ||
+ | |||
+ | |||
+ | '''SMTP helper classes''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TSMTPBuffer|<code>TSMTPBuffer = class(TObject)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''SMTP client classes''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TSMTPClient|<code>TSMTPClient = class(TWinsock2TCPClient)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | '''SMTP server classes''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TSMTPConnection|<code>TSMTPConnection = class(TListObject)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | [[TSMTPListener|<code>TSMTPListener = class(TWinsock2TCPListener)</code>]] | ||
+ | |- | ||
+ | |} | ||
+ | <br /> | ||
=== Public variables === | === Public variables === | ||
---- | ---- | ||
− | '' | + | |
+ | '''SMTP logging''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SMTP_DEFAULT_LOG_LEVEL:LongWord = SMTP_LOG_LEVEL_DEBUG;</code> | ||
+ | | style="width: 40%;"|Minimum level for SMTP messages. Only messages with level greater than or equal to this will be printed. | ||
+ | |- | ||
+ | |} | ||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>SMTP_LOG_ENABLED:Boolean;</code> | ||
+ | | style="width: 40%;"| | ||
+ | |- | ||
+ | |} | ||
+ | <br /> | ||
=== Function declarations === | === Function declarations === | ||
Line 334: | Line 449: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 349: | Line 464: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! ''' | + | ! Note |
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure SMTPLogInfo(const AText:String); inline;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
| None documented | | None documented | ||
|- | |- | ||
Line 356: | Line 483: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">procedure | + | <pre style="border: 0; padding-bottom:0px;">procedure SMTPLogWarn(const AText:String); inline;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 368: | Line 495: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">procedure SMTPLogError(const AText:String);</pre> | + | <pre style="border: 0; padding-bottom:0px;">procedure SMTPLogError(const AText:String); inline;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 380: | Line 507: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">procedure SMTPLogDebug(const AText:String);</pre> | + | <pre style="border: 0; padding-bottom:0px;">procedure SMTPLogDebug(const AText:String); inline;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- |
Latest revision as of 05:31, 31 August 2021
Return to Unit Reference
Contents
[hide]Description
Ultibo SMTP Interface unit
Constants
[Expand]
SMTP specific constants
SMTP_*
[Expand]
SMTP status
SMTP_STATUS_*
[Expand]
SMTP command
SMTP_COMMAND_*
[Expand]
SMTP sub command
SMTP_SUB_COMMAND_*
[Expand]
SMTP string
SMTP_STRING_*
[Expand]
SMTP logging
SMTP_LOG_*
Type definitions
SMTP client notify event
TSMTPClientNotifyEvent = procedure(const ARequest:String) of Object;
|
SMTP host event
TSMTPHostEvent = function(AConnection:TSMTPConnection):Boolean of Object;
|
SMTP count event
TSMTPCountEvent = function(AConnection:TSMTPConnection):Boolean of Object;
|
SMTP notify event
TSMTPNotifyEvent = procedure(AConnection:TSMTPConnection; const ARequest:String) of Object;
|
SMTP request event
TSMTPRequestEvent = function(AConnection:TSMTPConnection; const ARequest:String; var AReply:String):Boolean of Object;
|
SMTP authenticate event
TSMTPAuthenticateEvent = function(AConnection:TSMTPConnection; const AMethod,AUsername,APassword:String; var AReply:String):Boolean of Object;
|
SMTP connection event
TSMTPConnectionEvent = procedure(AConnection:TSMTPConnection) of Object;
|
Class definitions
SMTP helper classes
TSMTPBuffer = class(TObject)
|
SMTP client classes
TSMTPClient = class(TWinsock2TCPClient)
|
SMTP server classes
TSMTPConnection = class(TListObject)
|
TSMTPListener = class(TWinsock2TCPListener)
|
Public variables
SMTP logging
SMTP_DEFAULT_LOG_LEVEL:LongWord = SMTP_LOG_LEVEL_DEBUG;
|
Minimum level for SMTP messages. Only messages with level greater than or equal to this will be printed. |
SMTP_LOG_ENABLED:Boolean;
|
Function declarations
Initialization functions
SMTP helper functions
Return to Unit Reference