[evolvis-commits] r11312: added support for sending mail as text/html or text/plain ( defaults to text/plain for backwards compatibility) ↵
mirabilos at evolvis.org
mirabilos at evolvis.org
Thu Feb 24 18:07:25 CET 2011
Author: mirabilos
Date: 2011-02-24 18:07:25 +0100 (Thu, 24 Feb 2011)
New Revision: 11312
Modified:
trunk/gforge_base/evolvisforge-5.1/gforge/common/include/utils.php
Log:
added support for sending mail as text/html or text/plain (defaults to text/plain for backwards compatibility)
Modified: trunk/gforge_base/evolvisforge-5.1/gforge/common/include/utils.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/common/include/utils.php 2011-02-24 17:07:23 UTC (rev 11311)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/common/include/utils.php 2011-02-24 17:07:25 UTC (rev 11312)
@@ -86,9 +86,10 @@
* @param string The optional email sender address. Defaults to 'noreply@'
* @param string The addresses to blind-carbon-copy this message
* @param string The optional email sender name. Defaults to ''
+ * @param boolean Whether to send plain text or html email
*
*/
-function util_send_message($to,$subject,$body,$from='',$BCC='',$sendername='',$extra_headers='') {
+function util_send_message($to,$subject,$body,$from='',$BCC='',$sendername='',$extra_headers='',$send_html_email=false) {
global $Language,$sys_bcc_all_email_address,$sys_sendmail_path;
if (!$to) {
@@ -115,8 +116,9 @@
if(!empty($BCC)) {
$body2 .= "\nBCC: $BCC";
}
+ $send_html_email?$type="html":$type="plain";
$body2 .= "\nSubject: ".util_encode_mimeheader($subject, $charset).
- "\nContent-type: text/plain; charset=$charset".
+ "\nContent-type: text/$type; charset=$charset".
"\n\n".
util_convert_body($body, $charset);
More information about the evolvis-commits
mailing list