PHP 클래스 Horde_Smtp, horde

Implements the following SMTP-related RFCs:
  - RFC 1870/STD 10: Message Size Declaration
  - RFC 2034: Enhanced-Status-Codes
  - RFC 2195: CRAM-MD5 (SASL Authentication)
  - RFC 2595/4616: TLS & PLAIN (SASL Authentication)
  - RFC 2831: DIGEST-MD5 authentication mechanism (obsoleted by RFC 6331)
  - RFC 2920/STD 60: Pipelining
  - RFC 3207: Secure SMTP over TLS
  - RFC 3463: Enhanced Mail System Status Codes
  - RFC 4422: SASL Authentication (for DIGEST-MD5)
  - RFC 4954: Authentication
  - RFC 5321: Simple Mail Transfer Protocol
  - RFC 6152/STD 71: 8bit-MIMEtransport
  - RFC 6409/STD 72: Message Submission for Mail
  - RFC 6531: Internationalized Email

  - XOAUTH2: https://developers.google.com/gmail/xoauth2_protocol
TODO:
  - RFC 1845: CHECKPOINT
  - RFC 2852: DELIVERYBY
  - RFC 3030: BINARYMIME/CHUNKING
  - RFC 3461: DSN
  - RFC 3865: NO-SOLICITING
  - RFC 3885: MTRK
  - RFC 4141: CONPERM/CONNEG
  - RFC 4405: SUBMITTER
  - RFC 4468: BURL
  - RFC 4865: FUTURERELEASE
  - RFC 6710: MT-PRIORITY
  - RFC 7293: RRVS
저자: Michael Slusarz ([email protected])
상속: implements Serializable
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_connection Horde_Smtp_Connection Connection to the SMTP server.
$_debug Horde_Smtp_Debug The debug object.
$_ehlo string The hello command to use for extended SMTP support.
$_extensions array If this value is null, we have not connected to server yet.
$_params array Hash containing connection parameters.
$_requiredExts array List of required ESMTP extensions.

공개 메소드들

메소드 설명
__clone ( ) This object can not be cloned.
__construct ( array $params = [] ) Constructor.
__get ( $name )
getParam ( string $key ) : mixed Returns a value from the internal params array.
isSecureConnection ( ) : boolean Display if connection to the server has been secured via TLS or SSL.
login ( ) Connect/login to the SMTP server.
logout ( ) Logout from the SMTP server.
noop ( ) Send a NOOP command.
processQueue ( string $host = null ) Send request to process the remote queue.
queryExtension ( string $ext ) : mixed Returns whether the SMTP server supports the given extension.
resetCmd ( ) Send a reset command.
send ( mixed $from, mixed $to, mixed $data, array $opts = [] ) : array Send a message.
serialize ( )
setParam ( string $key, mixed $val ) Sets a configuration parameter value.
shutdown ( ) Shutdown actions.
unserialize ( $data )

보호된 메소드들

메소드 설명
_auth ( string $method ) Authenticate user to server for a given method.
_getEncryptKey ( ) : string Get encryption key.
_getHostname ( ) : string Return the local hostname.
_getResponse ( mixed $code, array $opts = [] ) : array Gets a line from the incoming stream and parses it.
_hello ( ) Send "Hello" command to the server.
_initOb ( ) Do initialization tasks.
_processData ( array $recipients ) : array Process the return from the DATA command.
_startTls ( ) : boolean Starts the TLS connection to the server, if necessary. See RFC 3207.

메소드 상세

__clone() 공개 메소드

This object can not be cloned.
public __clone ( )

__construct() 공개 메소드

Constructor.
public __construct ( array $params = [] )
$params array Configuration parameters: - chunk_size: (integer) If CHUNKING is supported on the server, the chunk size (in octets) to send. 0 will disable chunking. @since 1.7.0 - context: (array) Any context parameters passed to stream_create_context(). @since 1.9.0 - debug: (string) If set, will output debug information to the stream provided. The value can be any PHP supported wrapper that can be opened via fopen(). DEFAULT: No debug output - host: (string) The SMTP server. DEFAULT: localhost - localhost: (string) The hostname of the localhost. (since 1.9.0) DEFAULT: Auto-determined. - password: (mixed) The SMTP password or a Horde_Smtp_Password object (since 1.1.0). DEFAULT: NONE - port: (string) The SMTP port. DEFAULT: 587 (See RFC 6409/STD 72) - secure: (string) Use SSL or TLS to connect. DEFAULT: true (use 'tls' option, if available) - false (No encryption) - 'ssl' (Auto-detect SSL version) - 'sslv2' (Force SSL version 2) - 'sslv3' (Force SSL version 3) - 'tls' (TLS; started via protocol-level negotation over unencrypted channel; RECOMMENDED way of initiating secure connection) - 'tlsv1' (TLS direct version 1.x connection to server) [@since 1.3.0] - true (Use TLS, if available) [@since 1.2.0] - timeout: (integer) Connection timeout, in seconds. DEFAULT: 30 seconds - username: (string) The SMTP username. DEFAULT: NONE - xoauth2_token: (string) If set, will authenticate via the XOAUTH2 mechanism (if available) with this token. Either a string or a Horde_Smtp_Password object (since 1.1.0).

__get() 공개 메소드

public __get ( $name )

_auth() 보호된 메소드

Authenticate user to server for a given method.
protected _auth ( string $method )
$method string Authentication method.

_getEncryptKey() 보호된 메소드

Get encryption key.
사용 중단:
protected _getEncryptKey ( ) : string
리턴 string The encryption key.

_getHostname() 보호된 메소드

Return the local hostname.
protected _getHostname ( ) : string
리턴 string Local hostname (null if it cannot be determined).

_getResponse() 보호된 메소드

Gets a line from the incoming stream and parses it.
protected _getResponse ( mixed $code, array $opts = [] ) : array
$code mixed Expected reply code(s) (integer or array).
$opts array Additional options:
  - error: (string) On error, 'logout' or 'reset'?
  - exception: (string) Throw an exception of this class on error.
리턴 array An array with the response text.

_hello() 보호된 메소드

Send "Hello" command to the server.
protected _hello ( )

_initOb() 보호된 메소드

Do initialization tasks.
protected _initOb ( )

_processData() 보호된 메소드

Process the return from the DATA command.
또한 보기: _send()
protected _processData ( array $recipients ) : array
$recipients array The list of message recipients.
리턴 array See _send().

_startTls() 보호된 메소드

Starts the TLS connection to the server, if necessary. See RFC 3207.
protected _startTls ( ) : boolean
리턴 boolean True if TLS was started.

getParam() 공개 메소드

Returns a value from the internal params array.
public getParam ( string $key ) : mixed
$key string The param key.
리턴 mixed The param value, or null if not found.

isSecureConnection() 공개 메소드

Display if connection to the server has been secured via TLS or SSL.
public isSecureConnection ( ) : boolean
리턴 boolean True if the SMTP connection is secured.

login() 공개 메소드

Connect/login to the SMTP server.
public login ( )

logout() 공개 메소드

Logout from the SMTP server.
public logout ( )

noop() 공개 메소드

Send a NOOP command.
public noop ( )

processQueue() 공개 메소드

Send request to process the remote queue.
public processQueue ( string $host = null )
$host string The specific host to request queue processing for.

queryExtension() 공개 메소드

Returns whether the SMTP server supports the given extension.
public queryExtension ( string $ext ) : mixed
$ext string The extension to query.
리턴 mixed False if the server doesn't support the extension; otherwise, the extension value (returns true if the extension only supports existence).

resetCmd() 공개 메소드

Send a reset command.
public resetCmd ( )

send() 공개 메소드

Send a message.
public send ( mixed $from, mixed $to, mixed $data, array $opts = [] ) : array
$from mixed The from address. Either a Horde_Mail_Rfc822_Address object or a string.
$to mixed The to (recipient) addresses. Either a Horde_Mail_Rfc822_List object, a string, or an array of addresses.
$data mixed The data to send. Either a stream or a string.
$opts array
리턴 array If no receipients were successful, a Horde_Smtp_Exception will be thrown. If at least one recipient was successful, an array with the following format is returned: (@since 1.5.0) - KEYS: Recipient addresses ($to addresses). - VALUES: Boolean true (if message was accepted for this recpieint) or a Horde_Smtp_Exception (if messages was not accepted).

serialize() 공개 메소드

public serialize ( )

setParam() 공개 메소드

Sets a configuration parameter value.
public setParam ( string $key, mixed $val )
$key string The param key.
$val mixed The param value.

shutdown() 공개 메소드

Shutdown actions.
public shutdown ( )

unserialize() 공개 메소드

public unserialize ( $data )

프로퍼티 상세

$_connection 보호되어 있는 프로퍼티

Connection to the SMTP server.
protected Horde_Smtp_Connection $_connection
리턴 Horde_Smtp_Connection

$_debug 보호되어 있는 프로퍼티

The debug object.
protected Horde_Smtp_Debug $_debug
리턴 Horde_Smtp_Debug

$_ehlo 보호되어 있는 프로퍼티

The hello command to use for extended SMTP support.
protected string $_ehlo
리턴 string

$_extensions 보호되어 있는 프로퍼티

If this value is null, we have not connected to server yet.
protected array $_extensions
리턴 array

$_params 보호되어 있는 프로퍼티

Hash containing connection parameters.
protected array $_params
리턴 array

$_requiredExts 보호되어 있는 프로퍼티

List of required ESMTP extensions.
protected array $_requiredExts
리턴 array