Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
SMTPMailer Class Reference

Public Member Functions

 authenticate ()
 
 authenticate_cram_md5 ()
 
 authenticate_digest_md5 ()
 
 authenticate_login ()
 
 authenticate_plain ()
 
 connect ()
 
 disconnect ($error= '')
 
 hmac ($hashfn, $blocksize, $data, $key)
 
 hmac_md5 ($data, $key= '')
 
 mail (&$mail, $recipients, $subject, $body, $headers= '')
 
 receive ($expected)
 
 receiveData ($expected, &$data)
 
 send ($command, $data= '')
 
 SMTPMailer ()
 

Detailed Description

Class defining a simple SMTP mail client (reference RFCs 821 and 2821).

TODO: TLS support

Definition at line 21 of file SMTPMailer.inc.php.

Member Function Documentation

SMTPMailer::authenticate ( )

Authenticate using the specified mechanism.

Returns
boolean

Definition at line 235 of file SMTPMailer.inc.php.

References authenticate_cram_md5(), authenticate_digest_md5(), authenticate_login(), and authenticate_plain().

Referenced by mail().

SMTPMailer::authenticate_cram_md5 ( )

Authenticate using CRAM-MD5 (see RFC 2195).

Returns
boolean

Definition at line 283 of file SMTPMailer.inc.php.

References hmac_md5(), receive(), receiveData(), and send().

Referenced by authenticate().

SMTPMailer::authenticate_digest_md5 ( )

Authenticate using DIGEST-MD5 (see RFC 2831).

Returns
boolean

Definition at line 298 of file SMTPMailer.inc.php.

References receive(), receiveData(), and send().

Referenced by authenticate().

SMTPMailer::authenticate_login ( )

Authenticate using LOGIN.

Returns
boolean

Definition at line 265 of file SMTPMailer.inc.php.

References receive(), and send().

Referenced by authenticate().

SMTPMailer::authenticate_plain ( )

Authenticate using PLAIN.

Returns
boolean

Definition at line 254 of file SMTPMailer.inc.php.

References receive(), and send().

Referenced by authenticate().

SMTPMailer::connect ( )

Connect to the SMTP server.

Returns
boolean

Definition at line 164 of file SMTPMailer.inc.php.

Referenced by mail().

SMTPMailer::disconnect (   $error = '')

Disconnect from the SMTP server, sending a QUIT first.

Parameters
$successboolean
Returns
boolean

Definition at line 176 of file SMTPMailer.inc.php.

References receive(), and send().

Referenced by mail().

SMTPMailer::hmac (   $hashfn,
  $blocksize,
  $data,
  $key 
)

Generic HMAC digest computation (see RFC 2104).

Parameters
$hashfnstring e.g., 'md5' or 'sha1'
$blocksizeint
$datastring
$keystring
Returns
string (as hex)

Definition at line 361 of file SMTPMailer.inc.php.

Referenced by hmac_md5().

SMTPMailer::hmac_md5 (   $data,
  $key = '' 
)

Compute HMAC-MD5 digest.

Returns
string (as hex)

Definition at line 375 of file SMTPMailer.inc.php.

References hmac().

Referenced by authenticate_cram_md5().

SMTPMailer::mail ( $mail,
  $recipients,
  $subject,
  $body,
  $headers = '' 
)

Send mail.

Parameters
$mailMailer
$recipientsstring
$subjectstring
$bodystring
$headersstring

Definition at line 64 of file SMTPMailer.inc.php.

References authenticate(), connect(), disconnect(), PKPRequest\getServerHost(), receive(), and send().

SMTPMailer::receive (   $expected)

Receive a response.

Parameters
$expectedstring/array expected response code(s)
Returns
boolean

Definition at line 207 of file SMTPMailer.inc.php.

References receiveData().

Referenced by authenticate_cram_md5(), authenticate_digest_md5(), authenticate_login(), authenticate_plain(), disconnect(), and mail().

SMTPMailer::receiveData (   $expected,
$data 
)

Receive a response and return the data payload.

Parameters
$expectedstring/array expected response code
$datastring buffer
Returns
boolean

Definition at line 217 of file SMTPMailer.inc.php.

Referenced by authenticate_cram_md5(), authenticate_digest_md5(), and receive().

SMTPMailer::send (   $command,
  $data = '' 
)

Send a command/data.

Parameters
$commandstring
$datastring
Returns
boolean

Definition at line 195 of file SMTPMailer.inc.php.

Referenced by authenticate_cram_md5(), authenticate_digest_md5(), authenticate_login(), authenticate_plain(), disconnect(), and mail().

SMTPMailer::SMTPMailer ( )

Constructor.

Definition at line 44 of file SMTPMailer.inc.php.

References Config\getVar().


The documentation for this class was generated from the following file: