Warning: mail() has been disabled for security reasons in /www_host/hosts/*******.com/inc/utils.inc.php on line 422
/**
* Send email function
*
* @param string $sRecipientEmail - Email where email should be send
* @param string $sMailSubject - subject of the message
* @param string $sMailBody - Body of the message
* @param integer $iRecipientID - ID of recipient profile
* @param array $aPlus - Array of additional information
*
*
* @return boolean - trie if message was send
* - false if not
*/
function sendMail( $sRecipientEmail, $sMailSubject, $sMailBody, $iRecipientID = '', $aPlus = '', $sEmailFlag = 'text' ) {
global $site;
if( $iRecipientID )
$aRecipientInfo = getProfileInfo( $iRecipientID );
$sMailHeader = "From: =?UTF-8?B?" . base64_encode( $site['title'] ) . "?= <{$site['email_notify']}>";
$sMailParameters = "-f{$site['email_notify']}";
$sMailSubject = str_replace( "<SiteName>", $site['title'], $sMailSubject );
$sMailBody = str_replace( "<SiteName>", $site['title'], $sMailBody );
$sMailBody = str_replace( "<Domain>", $site['url'], $sMailBody );
$sMailBody = str_replace( "<recipientID>", $aRecipientInfo['ID'], $sMailBody );
$sMailBody = str_replace( "<RealName>", $aRecipientInfo['NickName'], $sMailBody );
$sMailBody = str_replace( "<NickName>", $aRecipientInfo['NickName'], $sMailBody );
$sMailBody = str_replace( "<Email>", $aRecipientInfo['Email'], $sMailBody );
$sMailBody = str_replace( "<Password>", $aRecipientInfo['Password'], $sMailBody );
if( is_array($aPlus) ) {
foreach ( $aPlus as $key => $value ) {
$sMailBody = str_replace( '<' . $key . '>', $value, $sMailBody );
}
}
$sMailSubject = '=?UTF-8?B?' . base64_encode( $sMailSubject ) . '?=';
$sMailHeader = "MIME-Version: 1.0\r\n" . $sMailHeader;
if( 'html' == $sEmailFlag) {
$sMailHeader = "Content-type: text/html; charset=UTF-8\r\n" . $sMailHeader;
$iSendingResult = mail( $sRecipientEmail, $sMailSubject, $sMailBody, $sMailHeader, $sMailParameters );
} else {
$sMailHeader = "Content-type: text/plain; charset=UTF-8\r\n" . $sMailHeader;
422 $iSendingResult = mail( $sRecipientEmail, $sMailSubject, html2txt($sMailBody), $sMailHeader, $sMailParameters );
}
return $iSendingResult;
}