seeddms-code/inc/inc.ClassEmailUtils.php
2015-11-25 16:49:09 +01:00

41 lines
1.2 KiB
PHP

<?php
/**
* Implementation of email utils
*
* @category DMS
* @package SeedDMS
* @license GPL 2
* @version @version@
* @author Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2002-2005 Markus Westphal,
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
* 2010 Uwe Steinmann
* @version Release: @package_version@
*/
/**
* Class to send email
*
* @category DMS
* @package SeedDMS
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
* @copyright Copyright (C) 2002-2005 Markus Westphal,
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
* 2010 Uwe Steinmann
* @version Release: @package_version@
*/
class SeedDMS_EmailUtils {
function sendPassword($sender, $recipient, $subject, $message) { /* {{{ */
$headers = array();
$headers[] = "MIME-Version: 1.0";
$headers[] = "Content-type: text/plain; charset=utf-8";
$headers[] = "From: ". $sender;
$headers[] = "Reply-To: ". $sender;
$subject = "=?UTF-8?B?".base64_encode($this->replaceMarker($subject))."?=";
return (mail($recipient->getEmail(), $subject, $this->replaceMarker($message), implode("\r\n", $headers)) ? 0 : -1);
} /* }}} */
}
?>