bludit/kernel/helpers/email.class.php

29 lines
790 B
PHP
Raw Normal View History

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';
2015-10-20 05:14:28 +02:00
$headers[] = 'Content-type: text/html; charset=utf-8';
2015-10-19 00:45:58 +02:00
$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>
2015-10-20 05:14:28 +02:00
<title>BLUDIT</title>
2015-08-03 02:49:12 +02:00
</head>
<body>
2015-10-19 00:45:58 +02:00
<div style="margin: 0px auto; border: 1px solid #2672ec; padding: 10px;">
2015-10-20 05:14:28 +02:00
<div style="font-size: 26px; padding: 10px; background-color: #2672ec; color: #FFFFFF;">BLUDIT</div>
'.$args['message'].'
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
}