/** * Send an e-mail. This function is a wrapper to the PHP mail function that * includes writing debugging data to the debug stream. * * @param smdoc $foowd Reference to the foowd environment object. * @param string to The e-mail address to send the e-mail to. * @param string subject The subject of the e-mail. * @param string message The message to send. * @param string headers Additional e-mail headers. * @param string para Additional e-mail parameters. * @return bool TRUE on success. */ function email(&$foowd, $to, $subject, $message, $headers = NULL, $para = NULL) { if ($foowd->debug) { $foowd->debug('msg', 'Sending e-mail:'); $foowd->debug('msg', 'To: ' . $to); $foowd->debug('msg', 'Subject: ' . $subject); $foowd->debug('msg', $headers); $foowd->debug('msg', $message); } //return @mail($to, $subject, $message, $headers, $para); return TRUE; }