2 /*=====================================================================*\
3 || ################################################################### ||
4 || # [#]app[#] [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # All parts of this file are ©2003-[#]year[#] Iris Studios, Inc. No # ||
7 || # part of this file may be reproduced in any way: part or whole. # ||
8 || # --------------------------------------------------------------- # ||
9 || # ©2003 - [#]year[#] Iris Studios, Inc. | http://www.iris-studios.com # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 // ########################### Start mymail ##########################
14 function mymail($toemail, $subject, $message, $fromemail = '', $headers = '', $fparam = true
)
18 // Make sure sendmail is at our disposal
19 if (!(@ini_get('sendmail_path')))
24 // Work out our sender
25 $fromemail = fetch_first_line($fromemail);
26 if ($fromemail == -1 OR !$fromemail)
28 if ($bugsys->options
['webmasteremail'])
30 $fromemail = fetch_first_line($bugsys->options
['webmasteremail']);
34 // Do we want a sender?
42 // Work out the recipient
43 $toemail = fetch_first_line($toemail);
49 // Work out the subject
50 $subject = fetch_first_line($subject);
53 $subject = $bugsys->options
['trackertitle'] . ' Notification';
57 $message = convert_standard_line_breaks($message);
63 // Construct mail headers
64 $headers = convert_standard_line_breaks($headers, "\n");
65 $headers .= "From: \"$fromemail\" <" . $bugsys->options
['webmasteremail'] . ">\n";
66 $headers .= "Return-Path: " . $bugsys->options
['webmasteremail'] . "\n";
67 $headers .= "X-Mailer: [#]app[#] [#]version[#] Mail\n";
68 $headers .= "Content-Type: text/plain; charset=\"" . $bugsys->options
['lang_charset'] . "\"\n";
69 $headers .= "Content-Transfer-Encoding: 7bit\n";
73 mail($toemail, $subject, $message, trim($headers), "-f $fromemail");
77 mail($toemail, $subject, $message, trim($headers));
81 // ###################### Start fetch_first_line #####################
82 function fetch_first_line($text)
84 $broken = explode("\r\n", convert_standard_line_breaks($text));
88 // ################ Start convert_standard_line_breaks ###############
89 function convert_standard_line_breaks($text, $convert_to = "\r\n")
91 return preg_replace("#(\r|\n|\r\n)#s", $convert_to, trim($text));
94 /*=====================================================================*\
95 || ###################################################################
98 || ###################################################################
99 \*=====================================================================*/