<?php
/**
*
* @name Pindorama Core Configuration
* @version 0.1
* @author Guilherme Capilé <hide@address.com>
*
*/
global $c;
require_once($c["components"]."core.php");
/**
*
* @name pin_manage_users
* @deprecated
* @version 0.11
*
* @author Guilherme Capilé <hide@address.com>
*
* @param $from
* @param $to
* @param $subject
* @param $message
*
* @global $c
*
* @see pin_read_xpath()
*
* @return
*/
function pin_send_email($from, $to, $subject, $message)
{
global $c;
$to = explode(" ", $to);
foreach($to as $tmp) {
$xpath[]="/xpml/resource/user[@id='$tmp']/email";
}
$tmpto = pin_read_xpath($xpath, "index:users");
$to = "";
foreach ($tmpto as $tmp) {
$to .= $tmp[0].", ";
}
if (strlen($to) > 2) {
$to = substr($to, 0, strlen($to) -2);
} else {
return false;
}
/* enviando o email */
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* additional headers */
$headers .= "From: ".$from;
$headers .= "\r\n";
$message = stripslashes($message);
/* and now mail it */
if (@mail($to, $subject, $message, $headers)) {
return true;
} else {
return false;
}
}
?>