Definition at line 9 of file EMail.php.
◆ __construct()
SimpleSAML_XHTML_EMail::__construct |
( |
|
$to, |
|
|
|
$subject, |
|
|
|
$from = null , |
|
|
|
$cc = null , |
|
|
|
$replyto = null |
|
) |
| |
◆ getHTML()
SimpleSAML_XHTML_EMail::getHTML |
( |
|
$body | ) |
|
|
private |
Definition at line 46 of file EMail.php.
References $body.
Referenced by send().
48 return '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 49 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 50 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 52 <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 53 <title>SimpleSAMLphp Email report</title> 54 <style type="text/css"> 56 margin: .4em 2em .4em 1em; 62 border: 1px solid #aaa; 67 <div class="container" style="background: #fafafa; border: 1px solid #eee; margin: 2em; padding: .6em;">
◆ send()
SimpleSAML_XHTML_EMail::send |
( |
| ) |
|
Definition at line 78 of file EMail.php.
References $from, $headers, $message, $replyto, SimpleSAML\Logger\debug(), getHTML(), and Monolog\Handler\mail().
80 if ($this->to === null) {
81 throw new Exception(
'EMail field [to] is required and not set.');
82 } elseif ($this->subject === null) {
83 throw new Exception(
'EMail field [subject] is required and not set.');
84 } elseif ($this->body === null) {
85 throw new Exception(
'EMail field [body] is required and not set.');
88 $random_hash = bin2hex(openssl_random_pseudo_bytes(16));
90 if (isset($this->from)) {
93 if (isset($this->replyto)) {
97 $this->headers[] =
'Content-Type: multipart/alternative; boundary="simplesamlphp-' . $random_hash .
'"';
100 --simplesamlphp-' . $random_hash .
' 101 Content-Type: text/plain; charset="utf-8" 102 Content-Transfer-Encoding: 8bit 104 ' . strip_tags(html_entity_decode($this->body)) .
' 106 --simplesamlphp-' . $random_hash .
' 107 Content-Type: text/html; charset="utf-8" 108 Content-Transfer-Encoding: 8bit 110 ' . $this->
getHTML($this->body) .
' 112 --simplesamlphp-' . $random_hash .
'-- 114 $headers = implode(
"\n", $this->headers);
119 throw new Exception(
'Error when sending e-mail');
mail($to, $subject, $message, $additional_headers=null, $additional_parameters=null)
catch(Exception $e) $message
◆ setBody()
SimpleSAML_XHTML_EMail::setBody |
( |
|
$body | ) |
|
◆ $body
SimpleSAML_XHTML_EMail::$body = null |
|
private |
◆ $cc
SimpleSAML_XHTML_EMail::$cc = null |
|
private |
◆ $from
SimpleSAML_XHTML_EMail::$from = null |
|
private |
◆ $headers
SimpleSAML_XHTML_EMail::$headers = array() |
|
private |
◆ $replyto
SimpleSAML_XHTML_EMail::$replyto = null |
|
private |
◆ $subject
SimpleSAML_XHTML_EMail::$subject = null |
|
private |
◆ $to
SimpleSAML_XHTML_EMail::$to = null |
|
private |
The documentation for this class was generated from the following file:
- libs/composer/vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/XHTML/EMail.php