SMTPClient Class
Properties Methods Events Configuration Settings Errors
The SMTPClient class provides client-side functionality for SMTP (Simple Mail Transfer Protocol).
Syntax
SecureBlackboxSMTPClient
SecureBlackboxSMTPClientSwift
Remarks
Use this component to send e-mails from your application.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
- blockedCertCount | The number of records in the BlockedCert arrays. |
- blockedCertBytes:(int)blockedCertIndex | Returns raw certificate data in DER format. |
- blockedCertHandle:(int)blockedCertIndex | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
- clientCertCount | The number of records in the ClientCert arrays. |
- clientCertBytes:(int)clientCertIndex | Returns raw certificate data in DER format. |
- clientCertHandle:(int)clientCertIndex | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
- connInfoAEADCipher | Indicates whether the encryption algorithm used is an AEAD cipher. |
- connInfoChainValidationDetails | The details of a certificate chain validation outcome. |
- connInfoChainValidationResult | The outcome of a certificate chain validation routine. |
- connInfoCiphersuite | The cipher suite employed by this connection. |
- connInfoClientAuthenticated | Specifies whether client authentication was performed during this connection. |
- connInfoClientAuthRequested | Specifies whether client authentication was requested during this connection. |
- connInfoConnectionEstablished | Indicates whether the connection has been established fully. |
- connInfoConnectionID | The unique identifier assigned to this connection. |
- connInfoDigestAlgorithm | The digest algorithm used in a TLS-enabled connection. |
- connInfoEncryptionAlgorithm | The symmetric encryption algorithm used in a TLS-enabled connection. |
- connInfoExportable | Indicates whether a TLS connection uses a reduced-strength exportable cipher. |
- connInfoKeyExchangeAlgorithm | The key exchange algorithm used in a TLS-enabled connection. |
- connInfoKeyExchangeKeyBits | The length of the key exchange key of a TLS-enabled connection. |
- connInfoNamedECCurve | The elliptic curve used in this connection. |
- connInfoPFSCipher | Indicates whether the chosen ciphersuite provides perfect forward secrecy (PFS). |
- connInfoPreSharedIdentityHint | A hint professed by the server to help the client select the PSK identity to use. |
- connInfoPublicKeyBits | The length of the public key. |
- connInfoResumedSession | Indicates whether a TLS-enabled connection was spawned from another TLS connection. |
- connInfoSecureConnection | Indicates whether TLS or SSL is enabled for this connection. |
- connInfoServerAuthenticated | Indicates whether server authentication was performed during a TLS-enabled connection. |
- connInfoSignatureAlgorithm | The signature algorithm used in a TLS handshake. |
- connInfoSymmetricBlockSize | The block size of the symmetric algorithm used. |
- connInfoSymmetricKeyBits | The key length of the symmetric algorithm used. |
- connInfoTotalBytesReceived | The total number of bytes received over this connection. |
- connInfoTotalBytesSent | The total number of bytes sent over this connection. |
- connInfoValidationLog | Contains the server certificate's chain validation log. |
- connInfoVersion | Indicates the version of SSL/TLS protocol negotiated during this connection. |
- domain | The sender host's domain name for HELO/EHLO. |
- externalCryptoCustomParams | Custom parameters to be passed to the signing service (uninterpreted). |
- externalCryptoData | Additional data to be included in the async state and mirrored back by the requestor. |
- externalCryptoExternalHashCalculation | Specifies whether the message hash is to be calculated at the external endpoint. |
- externalCryptoHashAlgorithm | Specifies the request's signature hash algorithm. |
- externalCryptoKeyID | The ID of the pre-shared key used for DC request authentication. |
- externalCryptoKeySecret | The pre-shared key used for DC request authentication. |
- externalCryptoMethod | Specifies the asynchronous signing method. |
- externalCryptoMode | Specifies the external cryptography mode. |
- externalCryptoPublicKeyAlgorithm | Provide public key algorithm here if the certificate is not available on the pre-signing stage. |
- knownCertCount | The number of records in the KnownCert arrays. |
- knownCertBytes:(int)knownCertIndex | Returns raw certificate data in DER format. |
- knownCertHandle:(int)knownCertIndex | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
- knownCRLCount | The number of records in the KnownCRL arrays. |
- knownCRLBytes:(int)knownCRLIndex | Returns raw CRL data in DER format. |
- knownCRLHandle:(int)knownCRLIndex | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
- knownOCSPCount | The number of records in the KnownOCSP arrays. |
- knownOCSPBytes:(int)knownOCSPIndex | Buffer containing raw OCSP response data. |
- knownOCSPHandle:(int)knownOCSPIndex | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
- msgAttachmentCount | Returns the number of attachments in this message. |
- msgBcc | The contents of the BCC header property. |
- msgCc | The value of the CC header property. |
- msgComments | Contains additional information about the message body. |
- msgDate | The date and time when the message entered the mail delivery system. |
- msgDeliveryReceipt | Enables delivery notification. |
- msgFrom | Contains the value of the From header property. |
- msgHtmlText | The HTML version of the message. |
- msgID | The contents of the Message-ID header property. |
- msgInReplyTo | The value of the In-Reply-To header property. |
- msgKeywords | The value of the Keywords header property. |
- msgMailer | The name of the software that was used to send the message. |
- msgPlainText | The plain text version of the message. |
- msgPriority | Specifies the message priority. |
- msgReadReceipt | Enables a read notification. |
- msgReferences | The value of the References header property. |
- msgReplyTo | The value of the Reply-To header property. |
- msgReturnPath | The value of the Return-Path header property. |
- msgSender | The value of the Sender header property. |
- msgSendTo | The value of the To header property. |
- msgSubject | Contains the subject property of this message. |
- password | The authentication password. |
- proxyAddress | The IP address of the proxy server. |
- proxyAuthentication | The authentication type used by the proxy server. |
- proxyPassword | The password to authenticate to the proxy server. |
- proxyPort | The port on the proxy server to connect to. |
- proxyProxyType | The type of the proxy server. |
- proxyRequestHeaders | Contains HTTP request headers for WebTunnel and HTTP proxy. |
- proxyResponseBody | Contains the HTTP or HTTPS (WebTunnel) proxy response body. |
- proxyResponseHeaders | Contains response headers received from an HTTP or HTTPS (WebTunnel) proxy server. |
- proxyUseIPv6 | Specifies whether IPv6 should be used when connecting through the proxy. |
- proxyUseProxy | Enables or disables proxy-driven connection. |
- proxyUsername | Specifies the username credential for proxy authentication. |
- serverCertCount | The number of records in the ServerCert arrays. |
- serverCertBytes:(int)serverCertIndex | Returns raw certificate data in DER format. |
- serverCertCAKeyID:(int)serverCertIndex | A unique identifier (fingerprint) of the CA certificate's private key. |
- serverCertFingerprint:(int)serverCertIndex | Contains the fingerprint (a hash imprint) of this certificate. |
- serverCertHandle:(int)serverCertIndex | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
- serverCertIssuer:(int)serverCertIndex | The common name of the certificate issuer (CA), typically a company name. |
- serverCertIssuerRDN:(int)serverCertIndex | A collection of information, in the form of [OID, Value] pairs, uniquely identifying the certificate issuer. |
- serverCertKeyAlgorithm:(int)serverCertIndex | Specifies the public key algorithm of this certificate. |
- serverCertKeyBits:(int)serverCertIndex | Returns the length of the public key. |
- serverCertKeyFingerprint:(int)serverCertIndex | Returns a fingerprint of the public key contained in the certificate. |
- serverCertKeyUsage:(int)serverCertIndex | Indicates the purposes of the key contained in the certificate, in the form of an OR'ed flag set. |
- serverCertPublicKeyBytes:(int)serverCertIndex | Contains the certificate's public key in DER format. |
- serverCertSelfSigned:(int)serverCertIndex | Indicates whether the certificate is self-signed (root) or signed by an external CA. |
- serverCertSerialNumber:(int)serverCertIndex | Returns the certificate's serial number. |
- serverCertSigAlgorithm:(int)serverCertIndex | Indicates the algorithm that was used by the CA to sign this certificate. |
- serverCertSubject:(int)serverCertIndex | The common name of the certificate holder, typically an individual's name, a URL, an e-mail address, or a company name. |
- serverCertSubjectKeyID:(int)serverCertIndex | Contains a unique identifier (fingerprint) of the certificate's private key. |
- serverCertSubjectRDN:(int)serverCertIndex | A collection of information, in the form of [OID, Value] pairs, uniquely identifying the certificate holder (subject). |
- serverCertValidFrom:(int)serverCertIndex | The time point at which the certificate becomes valid, in UTC. |
- serverCertValidTo:(int)serverCertIndex | The time point at which the certificate expires, in UTC. |
- serverInfoAuthLoginSupported | Whether the SMTP server supports LOGIN authentication method. |
- serverInfoAuthPlainSupported | Whether the SMTP server supports PLAIN authentication method. |
- serverInfoAvailable | Specifies whether server extensions are available. |
- serverInfoBinarySupported | Whether binary sending mode is supported by the SMTP server. |
- serverInfoChunkingSupported | Whether message chunking is supported by the SMTP server. |
- serverInfoDsnSupported | Whether the SMTP server supports Delivery Status Notifications. |
- serverInfoMaxMessageSize | Returns the maximum size of a message in bytes which the server can accept. |
- serverInfoSaslSupported | Whether the SMTP server supports SASL authentication. |
- serverInfoSizeSupported | Whether the SMTP server supports SIZE service extension. |
- serverInfoStatusCodesSupported | Whether the SMTP server supports status codes. |
- socketDNSMode | Selects the DNS resolver to use: the class's (secure) built-in one, or the one provided by the system. |
- socketDNSPort | Specifies the port number to be used for sending queries to the DNS server. |
- socketDNSQueryTimeout | The timeout (in milliseconds) for each DNS query. |
- socketDNSServers | The addresses of DNS servers to use for address resolution, separated by commas or semicolons. |
- socketDNSTotalTimeout | The timeout (in milliseconds) for the whole resolution process. |
- socketIncomingSpeedLimit | The maximum number of bytes to read from the socket, per second. |
- socketLocalAddress | The local network interface to bind the socket to. |
- socketLocalPort | The local port number to bind the socket to. |
- socketOutgoingSpeedLimit | The maximum number of bytes to write to the socket, per second. |
- socketTimeout | The maximum period of waiting, in milliseconds, after which the socket operation is considered unsuccessful. |
- socketUseIPv6 | Enables or disables IP protocol version 6. |
- TLSAutoValidateCertificates | Specifies whether server-side TLS certificates should be validated automatically using internal validation rules. |
- TLSBaseConfiguration | Selects the base configuration for the TLS settings. |
- TLSCiphersuites | A list of ciphersuites separated with commas or semicolons. |
- TLSECCurves | Defines the elliptic curves to enable. |
- TLSForceResumeIfDestinationChanges | Whether to force TLS session resumption when the destination address changes. |
- TLSPreSharedIdentity | Defines the identity used when the PSK (Pre-Shared Key) key-exchange mechanism is negotiated. |
- TLSPreSharedKey | Contains the pre-shared for the PSK (Pre-Shared Key) key-exchange mechanism, encoded with base16. |
- TLSPreSharedKeyCiphersuite | Defines the ciphersuite used for PSK (Pre-Shared Key) negotiation. |
- TLSRenegotiationAttackPreventionMode | Selects renegotiation attack prevention mechanism. |
- TLSRevocationCheck | Specifies the kind(s) of revocation check to perform. |
- TLSSSLOptions | Various SSL (TLS) protocol options, set of cssloExpectShutdownMessage 0x001 Wait for the close-notify message when shutting down the connection cssloOpenSSLDTLSWorkaround 0x002 (DEPRECATED) Use a DTLS version workaround when talking to very old OpenSSL versions cssloDisableKexLengthAlignment 0x004 Do not align the client-side PMS by the RSA modulus size. |
- TLSTLSMode | Specifies the TLS mode to use. |
- TLSUseExtendedMasterSecret | Enables Extended Master Secret Extension, as defined in RFC 7627. |
- TLSUseSessionResumption | Enables or disables TLS session resumption capability. |
- TLSVersions | Th SSL/TLS versions to enable by default. |
- trustedCertCount | The number of records in the TrustedCert arrays. |
- trustedCertBytes:(int)trustedCertIndex | Returns raw certificate data in DER format. |
- trustedCertHandle:(int)trustedCertIndex | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
- username | The authentication username. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
- config | Sets or retrieves a configuration setting. |
- connect | Establishes a connection to the SMTP server. |
- disconnect | Closes connection to the SMTP server. |
- sendBytes | Sends an e-mail message stored in a byte array. |
- sendFile | Sends an e-mail message stored in a file. |
- sendMessage | Sends a message to the SMTP server. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
- onBeforeAuth | Fires before the authentication starts. |
- onCertificateValidate | Fires when the server's TLS certificate has to be validated. |
- onCommand | Reports a command sent to the server. |
- onCommandData | Returns the data that accompanies the command. |
- onCommandReply | Reports the receipt of a reply to a command. |
- onError | Provides information about errors during SMTP operations. |
- onExternalSign | Handles remote or external signing initiated by the SignExternal method or other source. |
- onNotification | This event notifies the application about an underlying control flow event. |
- onProgress | Reports the progress of the data transfer operation. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
Authentications | Specifies enabled authentication methods and their priorities. |
BinaryChunkSize | Specifies the size of chunks to use for dividing outgoing messages in binary mode. |
BinaryMode | Specifies whether binary mode is allowed for sending. |
ForceLogin | Forces the class to login to the server. |
IgnoreSystemTrust | Whether trusted Windows Certificate Stores should be treated as trusted. |
RemoveBCC | Specifies if BCC header fields should be removed from messages. |
SendBufferSize | Size of send buffer in bytes. |
TempPath | Path for storing temporary files. |
TolerateMinorChainIssues | Whether to tolerate minor chain issues. |
UseMicrosoftCTL | Enables or disables automatic use of Microsoft online certificate trust list. |
UseSystemCertificates | Enables or disables the use of the system certificates. |
CheckKeyIntegrityBeforeUse | Enables or disable private key integrity check before use. |
CookieCaching | Specifies whether a cookie cache should be used for HTTP(S) transports. |
Cookies | Gets or sets local cookies for the class (supported for HTTPClient, RESTClient and SOAPClient only). |
DefDeriveKeyIterations | Specifies the default key derivation algorithm iteration count. |
EnableClientSideSSLFFDHE | Enables or disables finite field DHE key exchange support in TLS clients. |
GlobalCookies | Gets or sets global cookies for all the HTTP transports. |
HttpUserAgent | Specifies the user agent name to be used by all HTTP clients. |
LogDestination | Specifies the debug log destination. |
LogDetails | Specifies the debug log details to dump. |
LogFile | Specifies the debug log filename. |
LogFilters | Specifies the debug log filters. |
LogFlushMode | Specifies the log flush mode. |
LogLevel | Specifies the debug log level. |
LogMaxEventCount | Specifies the maximum number of events to cache before further action is taken. |
LogRotationMode | Specifies the log rotation mode. |
MaxASN1BufferLength | Specifies the maximal allowed length for ASN.1 primitive tag data. |
MaxASN1TreeDepth | Specifies the maximal depth for processed ASN.1 trees. |
OCSPHashAlgorithm | Specifies the hash algorithm to be used to identify certificates in OCSP requests. |
UseOwnDNSResolver | Specifies whether the client classes should use own DNS resolver. |
UseSharedSystemStorages | Specifies whether the validation engine should use a global per-process copy of the system certificate stores. |
UseSystemOAEPAndPSS | Enforces or disables the use of system-driven RSA OAEP and PSS computations. |
UseSystemRandom | Enables or disables the use of the OS PRNG. |