Class Deliver_SMTP

Description

Deliver messages using SMTP

  • author: Marc Groot Koerkamp

Located in /nasmail/class/deliver/Deliver_SMTP.class.php (line 22)

Deliver
   |
   --Deliver_SMTP
Variable Summary
 string $dlv_msg
 integer $dlv_ret_nr
 string $domain
 array $ehlo
 boolean $tls_enabled
Method Summary
 boolean authPop ([string $pop_server = ''], [integer $pop_port = ''], string $user, string $pass)
 boolean errorCheck (string $line, stream $smtpConnection)
 boolean finalizeStream (stream $stream)
 mixed initStream (Message $message, string $domain, [integer $length = 0], [string $host = ''], [integer $port = ''], [string $user = ''], [string $pass = ''], [boolean $authpop = false])
 string parse_ehlo_response (stream $stream)
 void preWriteToStream ( &$s, string $s)
Variables
string $dlv_msg = '' (line 47)
  • var: delivery error message
integer $dlv_ret_nr = '' (line 49)
  • var: delivery error number from server
string $dlv_server_msg = '' (line 51)
  • var: delivery error message from server
string $domain = '' (line 32)
  • var: domain
array $ehlo = array() (line 28)

Array keys are uppercased ehlo keywords array key values are ehlo params. If ehlo-param contains space, it is splitted into array.

  • var: ehlo
boolean $tls_enabled = false (line 39)

SMTP STARTTLS rfc: "Both the client and the server MUST know if there is a TLS session active." Variable should be set to true, when encryption is turned on.

Methods
authPop (line 467)

Function is used for POP-before-SMTP authentication

  • return: false on error, true on success. Before 1.2 function returned int(0) on error and void on success.
boolean authPop ([string $pop_server = ''], [integer $pop_port = ''], string $user, string $pass)
  • string $pop_server: name or address of popserver. if empty, defaults to localhost
  • integer $pop_port: port of POP server, if empty, defaults to 110
  • string $user: username
  • string $pass: password
errorCheck (line 392)

check if an SMTP reply is an error and set an error message)

  • return: false on smtp error.
boolean errorCheck (string $line, stream $smtpConnection)
  • string $line
  • stream $smtpConnection: SMTP connection resource
finalizeStream (line 374)
  • return: FIXME. return is int(0) or true
boolean finalizeStream (stream $stream)
  • stream $stream: SMTP connection resource
initStream (line 77)

Starts SMTP connection

  • return: smtp connection resource or int(0)
mixed initStream (Message $message, string $domain, [integer $length = 0], [string $host = ''], [integer $port = ''], [string $user = ''], [string $pass = ''], [boolean $authpop = false])
  • Message $message: Message object
  • string $domain
  • integer $length
  • string $host: hostname of SMTP server
  • integer $port: port of SMTP server
  • string $user: username
  • string $pass: password
  • boolean $authpop: Is POP-before-SMTP authentication used?

Redefinition of:
Deliver::initStream()
function initStream - reserved for extended functionality
parse_ehlo_response (line 508)

Parses ESMTP EHLO response (rfc1869)

Reads SMTP response to EHLO command and fills class variables (ehlo array and domain string). Returns last line.

  • return: last ehlo line
string parse_ehlo_response (stream $stream)
  • stream $stream: smtp connection stream.
preWriteToStream (line 58)

Prepares message for processing in smtp data command

void preWriteToStream ( &$s, string $s)
  • string $s
  • &$s

Redefinition of:
Deliver::preWriteToStream()
function preWriteToStream - reserved for extended functionality

Inherited Methods

Inherited From Deliver

 Deliver::calculate_references()
 Deliver::clean_crlf()
 Deliver::foldLine()
 Deliver::getBCC()
 Deliver::initStream()
 Deliver::ip2hex()
 Deliver::mail()
 Deliver::mimeBoundary()
 Deliver::prepareMIME_Header()
 Deliver::prepareRFC822_Header()
 Deliver::preWriteToStream()
 Deliver::strip_crlf()
 Deliver::timezone()
 Deliver::writeBody()
 Deliver::writeBodyPart()
 Deliver::writeToStream()

Documentation generated on Sun, 22 Nov 2009 17:36:26 +0200 by phpDocumentor 1.4.3