<commit_before><?php
/** Extension htmlMimeMail
  * set some default params (mainly utf8 as titi is utf8) + use the mailCharset pref from a user
  */
global $access;
$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__));
include_once("lib/webmail/htmlMimeMail.php");

class TikiMail extends HtmlMimeMail {
		var $charset;
	
	/* $user = user you send the mail
	   $from = email you send from*/
	function TikiMail($user = null, $from=null) {
		global $prefs, $tikilib;

		parent::htmlMimeMail();
		$this->charset = !$user ? $prefs['default_mail_charset'] : $tikilib->get_user_preference($user, 'mailCharset', 'utf-8');
		$this->setTextCharset($this->charset);
		$this->setHtmlCharset($this->charset);
		$this->setHeadCharset($this->charset);
		if (isset($prefs['mail_crlf']))
			$this->setCrlf($prefs['mail_crlf'] == "LF"? "\n": "\r\n");
		if (empty($from))
			$from = $prefs['sender_email'];
		$this->setFrom($from);
		if (!@ini_get('safe_mode'))
			$this->setReturnPath($from); // in safe-mode, return-path must then be configured at the server level
		$this->setHeader("Return-Path", "<".$from.">"); // just in case, mainly will not work as usually the server rewrites the envelop
		$this->setHeader("Reply-To",  "<".$from.">");<commit_msg>[FIX] The previous syntax caused Reply-To issues with valid return emails such as 'TW Notification <<EMAIL>>'<commit_after><?php
/** Extension htmlMimeMail
  * set some default params (mainly utf8 as titi is utf8) + use the mailCharset pref from a user
  */
global $access;
$access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__));
include_once("lib/webmail/htmlMimeMail.php");

class TikiMail extends HtmlMimeMail {
		var $charset;

	/* $user = user you send the mail
	   $from = email you send from*/
	function TikiMail($user = null, $from=null) {
		global $prefs, $tikilib;

		parent::htmlMimeMail();
		$this->charset = !$user ? $prefs['default_mail_charset'] : $tikilib->get_user_preference($user, 'mailCharset', 'utf-8');
		$this->setTextCharset($this->charset);
		$this->setHtmlCharset($this->charset);
		$this->setHeadCharset($this->charset);
		if (isset($prefs['mail_crlf']))
			$this->setCrlf($prefs['mail_crlf'] == "LF"? "\n": "\r\n");
		if (empty($from))
			$from = $prefs['sender_email'];
		$this->setFrom($from);
		if (!@ini_get('safe_mode'))
			$this->setReturnPath($from); // in safe-mode, return-path must then be configured at the server level
		$this->setHeader("Return-Path", $from); // just in case, mainly will not work as usually the server rewrites the envelop
		$this->setHeader("Reply-To",  $from);
{'fraction_non_alphanumeric': 0.17833655705996132, 'fraction_numerical': 0.0023210831721470018, 'mean_word_length': 5.1571428571428575, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3800057', 'n_tokens_mistral': 941, 'n_tokens_neox': 874, 'n_words': 216}