Hoa central
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Hoa\Mail\Transport\Sendmail Class Reference
Inheritance diagram for Hoa\Mail\Transport\Sendmail:

Public Member Functions

 __construct (Array $parameters=[])
 
 getParameters ()
 
 send (Mail\Message $message)
 

Protected Member Functions

 setParameters (Array $parameters)
 

Protected Attributes

 $_parameters = null
 

Detailed Description

Class .

This class allows to send an email by using sendmail (through the PHP mail() function).

Definition at line 50 of file Sendmail.php.

Constructor & Destructor Documentation

Hoa\Mail\Transport\Sendmail::__construct ( Array  $parameters = [])

Constructor.

Parameters
array$parametersAdditional parameters for the mail() function.
Returns
void

Definition at line 68 of file Sendmail.php.

69  {
70  $this->_parameters = $parameters;
71 
72  return;
73  }

Member Function Documentation

Hoa\Mail\Transport\Sendmail::getParameters ( )

Get additional parameters.

Returns
array

Definition at line 94 of file Sendmail.php.

95  {
96  return $this->_parameters;
97  }
Hoa\Mail\Transport\Sendmail::send ( Mail\Message  $message)

Send a message.

Parameters
\Hoa\Mail\Message$messageMessage.
Returns
bool

Implements Hoa\Mail\Transport\ITransport\Out.

Definition at line 105 of file Sendmail.php.

106  {
107  $content = $message->getFormattedContent();
108  $headers = $message->getHeaders();
109  $pos = strpos($content, CRLF . CRLF);
110  $_headers = substr($content, 0, $pos);
111  $_body = substr($content, $pos + 4);
112 
113  return mail(
114  $headers['to'],
115  $headers['subject'],
116  $_body,
117  $_headers,
118  $message->formatHeaders($this->getParameters())
119  );
120  }
$content
Definition: Hoa.php:119
Hoa\Mail\Transport\Sendmail::setParameters ( Array  $parameters)
protected

Set additional parameters.

Parameters
array$parametersAdditional parameters.
Returns
array

Definition at line 81 of file Sendmail.php.

82  {
83  $old = $this->_parameters;
84  $this->_parameters = $parameters;
85 
86  return $old;
87  }

Member Data Documentation

Hoa\Mail\Transport\Sendmail::$_parameters = null
protected

Definition at line 57 of file Sendmail.php.


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