mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-18 02:41:24 +02:00
Merge pull request #521 from elyobo/additional-parameters
Allow passing additional parameters to PHP's mail().
This commit is contained in:
@@ -39,6 +39,12 @@ class NativeMailerHandler extends MailHandler
|
|||||||
*/
|
*/
|
||||||
protected $headers = array();
|
protected $headers = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optional parameters for the message
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $parameters = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The wordwrap length for the message
|
* The wordwrap length for the message
|
||||||
* @var integer
|
* @var integer
|
||||||
@@ -90,6 +96,19 @@ class NativeMailerHandler extends MailHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add parameters to the message
|
||||||
|
*
|
||||||
|
* @param string|array $arguments Custom added parameters
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function addParameter($parameters)
|
||||||
|
{
|
||||||
|
$this->parameters = array_merge($this->parameters, (array) $parameters);
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
@@ -102,7 +121,7 @@ class NativeMailerHandler extends MailHandler
|
|||||||
$headers .= 'MIME-Version: 1.0' . "\r\n";
|
$headers .= 'MIME-Version: 1.0' . "\r\n";
|
||||||
}
|
}
|
||||||
foreach ($this->to as $to) {
|
foreach ($this->to as $to) {
|
||||||
mail($to, $this->subject, $content, $headers);
|
mail($to, $this->subject, $content, $headers, implode(' ', $this->parameters));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user