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 36 of file EMail.php.
References $body.
Referenced by send().
37 return '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 38 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 39 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 41 <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 42 <title>SimpleSAMLphp Email report</title> 43 <style type="text/css"> 45 margin: .4em 2em .4em 1em; 51 border: 1px solid #aaa; 56 <div class="container" style="background: #fafafa; border: 1px solid #eee; margin: 2em; padding: .6em;">
◆ send()
SimpleSAML_XHTML_EMail::send |
( |
| ) |
|
Definition at line 63 of file EMail.php.
References $from, $headers, $message, $replyto, SimpleSAML\Logger\debug(), getHTML(), Monolog\Handler\mail(), and to.
64 if ($this->
to == NULL)
throw new Exception(
'EMail field [to] is required and not set.');
65 if ($this->subject == NULL)
throw new Exception(
'EMail field [subject] is required and not set.');
66 if ($this->body == NULL)
throw new Exception(
'EMail field [body] is required and not set.');
68 $random_hash = bin2hex(openssl_random_pseudo_bytes(16));
70 if (isset($this->from))
72 if (isset($this->replyto))
75 $this->headers[] =
'Content-Type: multipart/alternative; boundary="simplesamlphp-' . $random_hash .
'"';
78 --simplesamlphp-' . $random_hash .
' 79 Content-Type: text/plain; charset="utf-8" 80 Content-Transfer-Encoding: 8bit 82 ' . strip_tags(html_entity_decode($this->body)) .
' 84 --simplesamlphp-' . $random_hash .
' 85 Content-Type: text/html; charset="utf-8" 86 Content-Transfer-Encoding: 8bit 88 ' . $this->
getHTML($this->body) .
' 90 --simplesamlphp-' . $random_hash .
'-- 92 $headers = implode(
"\n", $this->headers);
96 if (!$mail_sent)
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