2015-08-03 02:49:12 +02:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
2015-03-08 18:02:59 +01:00
|
|
|
|
|
|
|
class Email {
|
|
|
|
|
2015-10-19 00:45:58 +02:00
|
|
|
// Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise.
|
2015-03-08 18:02:59 +01:00
|
|
|
public static function send($args)
|
|
|
|
{
|
2015-10-19 00:45:58 +02:00
|
|
|
$headers = array();
|
|
|
|
$headers[] = 'MIME-Version: 1.0';
|
|
|
|
$headers[] = 'Content-type: text/plain; charset=utf-8';
|
|
|
|
$headers[] = 'From: '.$args['from'];
|
|
|
|
$headers[] = 'X-Mailer: PHP/'.phpversion();
|
2015-03-08 18:02:59 +01:00
|
|
|
|
|
|
|
$message = '<html>
|
2015-08-03 02:49:12 +02:00
|
|
|
<head>
|
|
|
|
<title>Bludit</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
2015-10-19 00:45:58 +02:00
|
|
|
<div style="margin: 0px auto; border: 1px solid #2672ec; padding: 10px;">
|
|
|
|
<div style="font-size: 26px; padding: 10px; background-color: #2672ec;">Bludit</div>
|
|
|
|
<p>'.$args['message'].'</p>
|
2015-08-03 02:49:12 +02:00
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>';
|
2015-03-08 18:02:59 +01:00
|
|
|
|
2015-10-19 00:45:58 +02:00
|
|
|
return mail($args['to'], $args['subject'], $message, implode(PHP_EOL, $headers));
|
2015-03-08 18:02:59 +01:00
|
|
|
}
|
|
|
|
|
2015-10-19 00:45:58 +02:00
|
|
|
}
|