本文整理汇总了PHP中SMTPMail函数的典型用法代码示例。如果您正苦于以下问题:PHP SMTPMail函数的具体用法?PHP SMTPMail怎么用?PHP SMTPMail使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SMTPMail函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendMail
function sendMail($id, $to, $mailBody, $subject, $conn)
{
$sql = "Select * from tbl_help_address where id='{$id}'";
$result = executeSelect($sql, $conn);
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_array($result);
$replyName = $row["vReplyName"];
$replyAddress = $row["vReplyAddress"];
$fromName = $row["vFromName"];
$fromAddress = $row["vFromAddress"];
}
$EMail = $to;
$Headers = "From: {$fromName} <{$fromAddress}>\n";
$Headers .= "Reply-To: {$replyName} <{$replyAddress}>\n";
$Headers .= "MIME-Version: 1.0\n";
$Headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
// it is for smtp mail sending
if ($_SESSION["sess_smtpsettings"] == 1) {
$var_smtpserver = $_SESSION["sess_smtpserver"];
$var_port = $_SESSION["sess_smtpport"];
SMTPMail($fromAddress, $EMail, $var_smtpserver, $var_port, $subject, $mailBody);
} else {
@mail($EMail, $subject, $mailBody, $Headers);
}
}
示例2: enviarEmail
public function enviarEmail()
{
if ($_SESSION["sess_smtpsettings"] == 1) {
$cliente = $this->getCliente();
$var_smtpserver = $_SESSION["sess_smtpserver"];
$var_port = $_SESSION["sess_smtpport"];
$var_body = $this->getCitacionEmail();
$var_subject = "Citación de Acsa";
SMTPMail('info@acsa.com', $cliente["vEmail"], $var_smtpserver, $var_port, $var_subject, $var_body);
}
}
示例3: SMTPMail
$var_mail_body = $var_emailheader . "<br>" . ($var_mail_body .= MESSAGE_YOU_HAVE_REQUESTED_FOR_PASSWORD_RESET . $var_helpdeskname . "<br>");
$var_mail_body .= MESSAGE_CLICK_TO_RESET_PASSWORD . "<br><br>";
$var_mail_body .= "<a href=\"{$link}\">" . $link . "</a><br><br>";
$var_mail_body .= $var_emailfooter;
$var_body = $var_mail_body;
$var_subject = MESSAGE_CONFIRM_PASSWORD_RESET_REQUEST;
$var_email_to = $useremail;
$Headers = "From: {$var_fromName} <{$var_fromMail}>\n";
$Headers .= "Reply-To: {$var_replyName} <{$var_replyMail}>\n";
$Headers .= "MIME-Version: 1.0\n";
$Headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
// it is for smtp mail sending
if ($_SESSION["sess_smtpsettings"] == 1) {
$var_smtpserver = $_SESSION["sess_smtpserver"];
$var_port = $_SESSION["sess_smtpport"];
SMTPMail($var_fromMail, $var_email_to, $var_smtpserver, $var_port, $var_subject, $var_body);
} else {
@mail($var_email_to, $var_subject, $var_body, $Headers);
}
/*****************************************************************************/
$infomessage = MESSAGE_LINK_FOR_PASSWORD_RESET_SENT_TO . "'" . $var_email_to . "'";
} else {
$error = true;
$passworderrormessage = MESSAGE_EMAIL_DONOT_EXIST;
}
}
}
?>
<script>
function checkGetPasswordForm(){
示例4: stripslashes
// mail if the status is changed to escalated
if ($frm_status == "escalated" && $mail_status != "escalated") {
// mail admin if escalated
$var_body = $var_emailheader . "<br>" . TEXT_MAIL_START . " Admin,<br>";
$var_body .= TEXT_ESCALATED_BODY . " " . $mail_refno . TEXT_MAIL_BY . stripslashes($_SESSION['sess_staffname']) . "<br><br>";
$var_body .= TEXT_MAIL_THANK . "<br>" . stripslashes($var_helpdesktitle) . "<br>" . $var_emailfooter;
$var_subject = TEXT_ESCALATION_SUB;
$Headers = "From: {$var_fromName} <{$var_fromMail}>\n";
$Headers .= "Reply-To: {$var_replyName} <{$var_replyMail}>\n";
$Headers .= "MIME-Version: 1.0\n";
$Headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
// it is for smtp mail sending
if ($_SESSION["sess_smtpsettings"] == 1) {
$var_smtpserver = $_SESSION["sess_smtpserver"];
$var_port = $_SESSION["sess_smtpport"];
SMTPMail($var_fromMail, $var_emailescalation, $var_smtpserver, $var_port, $var_subject, $var_body);
} else {
$mailstatus = @mail($var_emailescalation, $var_subject, $var_body, $Headers);
}
}
//end mail admin
// end mail escalated
if ($frm_status == "closed") {
sendMailUserTicketClose($mail_refno, $var_helpdesktitle);
}
// Mail send to user on ticket close ends
$var_message = MESSAGE_RECORD_UPDATED;
$flag_msg = "class='msg_success'";
}
}
mysql_free_result($rs);
示例5: utf8_encode
$var_mail_body .= "<br>" . utf8_encode($var_helpdesktitle) . "<br>".$var_emailfooter;
$var_body = $var_mail_body;
$var_subject = TEXT_EMAIL_FORWARDED_SUB;
$Headers="From: $var_fromName <$var_fromMail>\n";
$Headers="CC: $var_forward_email_cc <$var_forward_email_cc>\n";
$Headers.="Reply-To: $var_replyName <$var_replyMail>\n";
$Headers.="MIME-Version: 1.0\n";
$Headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
// it is for smtp mail sending
if($_SESSION["sess_smtpsettings"] == 1) {
$var_smtpserver = $_SESSION["sess_smtpserver"];
$var_port = $_SESSION["sess_smtpport"];
SMTPMail($var_fromMail,$var_email,$var_smtpserver,$var_port,$var_subject,$var_body,"",$var_forward_email_cc);
}
else
$mailstatus=@mail($var_email,$var_subject,$var_body,$Headers);
$var_message_forwarded = MESSAGE_RECORD_FORWARDED;
$flag_msg = "class='msg_success'";
$var_forward_email ="";
$var_forward_email_cc ="";
$var_forward_comments= ""; // ticket forward email ends here
}else {
$_SESSION['sess_backurl'] = getPageAddress();
}
// added on 1-11-06 by roshith for ticket reply re-directing
if(isset($_GET['msg'])) {
$message = MESSAGE_TICKET_REPLIED;
示例6: mysql_insert_id
$var_new_id = mysql_insert_id();
if (logActivity()) {
$sql = "Insert into sptbl_actionlog(nALId,nStaffId,vAction,vArea,nRespId,dDate) Values('','{$var_staffid}','" . mysql_real_escape_string(TEXT_ADDITION) . "','PrivateMessages','" . mysql_real_escape_string($var_new_id) . "',now())";
executeQuery($sql, $conn);
}
//notify on pvt message - added on December 27, 2005
$sql = "Select vMail,nNotifyPvtMsg from sptbl_staffs where nStaffId='" . mysql_real_escape_string($arr_userid[$i]) . "'";
$result = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_array($result);
if ($row["nNotifyPvtMsg"] == "1" && $row["vMail"] != "") {
// it is for smtp mail sending
if ($_SESSION["sess_smtpsettings"] == 1) {
$var_smtpserver = $_SESSION["sess_smtpserver"];
$var_port = $_SESSION["sess_smtpport"];
SMTPMail($var_fromMail, $row["vMail"], $var_smtpserver, $var_port, $var_subject, $var_body);
} else {
@mail($row["vMail"], $var_subject, $var_body, $Headers);
}
}
}
}
$var_message = MESSAGE_RECORD_SENT;
$flag_msg = "class='msg_success'";
$var_title = stripslashes($var_title);
$var_desc = stripslashes($var_desc);
}
}
?>
<form name="frmPvtMessage" method="POST" action="<?php
echo $_SERVER["REQUEST_URI"];
示例7: substr
}
$var_tolist = substr($var_tolist, 1);
if ($var_tolist != "") {
$var_mail_body = $var_emailheader . "<br>Hi,<br>" . ($var_mail_body .= TEXT_MAIL_BODY . ":" . $var_refno . "<br><br>");
$var_mail_body .= nl2br(htmlentities($var_replymatter)) . "<br>" . $var_emailfooter;
$var_subject = "Re:" . $var_tickettitle . " Id#[" . $var_refno . "]";
$var_body = $var_mail_body;
$Headers = "From: {$var_fromName} <{$var_fromMail}>\n";
$Headers .= "Reply-To: {$var_replyName} <{$var_replyMail}>\n";
$Headers .= "MIME-Version: 1.0\n";
$Headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
// it is for smtp mail sending
if ($_SESSION["sess_smtpsettings"] == 1) {
$var_smtpserver = $_SESSION["sess_smtpserver"];
$var_port = $_SESSION["sess_smtpport"];
SMTPMail($var_fromMail, $var_tolist, $var_smtpserver, $var_port, $var_subject, $var_body);
} else {
@mail($var_tolist, $var_subject, $var_body, $Headers);
}
}
//End Send mail
//clear the fields
$var_userid = $_POST['userid'];
$var_tickettitle = "";
$var_refno = "";
$var_tmplate_id = "";
$var_replymatter = "";
$var_pntitle = "";
$var_pnmatter = "";
$var_addtokb = "";
$var_category = "";
示例8: htmlentities
$var_mail_body .= "<br>";
$var_mail_body .= TEXT_DEPARTMENT . ": " . htmlentities(getDepartmentName($var_departmentid)) . "<br>";
$var_mail_body .= TEXT_ENTRY_TITLE . ": " . htmlentities($var_kbtitle) . "<br>";
$var_mail_body .= "<br>";
$var_mail_body .= "<br>" . TEXT_THANKS . "<br>" . htmlentities($var_helpdesktitle) . "<br>" . $var_emailfooter;
$var_subject = TEXT_A_NEW_KB_ENTRY_POSTED;
$var_body = $var_mail_body;
$headers = "From: {$var_fromName} <{$var_fromMail}>\n";
$headers .= "Reply-To: {$var_replyName} <{$var_replyMail}>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
// it is for smtp mail sending
if ($_SESSION["sess_smtpsettings"] == 1) {
$var_smtpserver = $_SESSION["sess_smtpserver"];
$var_port = $_SESSION["sess_smtpport"];
SMTPMail($var_fromMail, $emailstonotify, $var_smtpserver, $var_port, $var_subject, $var_body);
} else {
$mailstatus = @mail($emailstonotify, $var_subject, $var_body, $headers);
}
}
}
$message = true;
$infomessage = MESSAGE_RECORD_ADDED_SUCCESSFULLY;
$flag_msg = 'class="msg_success"';
$var_kbtitle = "";
$var_kbdesc = "";
$var_kbmetatagkeyword = "";
$var_kbmetatagdescription = "";
}
} elseif ($_POST["postback"] == "D") {
if (!$error) {
示例9: mailWatcher
function mailWatcher($var_deptid, $var_refno, $var_smtp_status)
{
global $arr_tolist, $var_fromaddress, $arr_lookupvalues, $arr_user_login, $arr_new_user, $conn;
$sqlWatcher = "select s.vStaffname,s.vMail from sptbl_staffs s inner join sptbl_staffdept sd on s.nStaffId=sd.nStaffId ";
$sqlWatcher .= " where ndeptid='{$var_deptid}' and s.nWatcher=1 ";
$resultWatcher = executeSelect($sqlWatcher, $conn);
$var_tolist = "";
while ($row = mysql_fetch_array($resultWatcher)) {
// $var_tolist .= "," . $row["vMail"];
// }
// $var_tolist = substr($var_tolist,1);
$var_tolist = $row["vMail"];
$var_staffname = $row["vStaffname"];
if ($var_tolist != "") {
$var_body = $arr_lookupvalues['var_emailheader'] . "<br>" . TEXT_MAIL_START . " {$var_staffname},<br> <br>";
$var_body .= "<br><br>";
$var_body .= TEXT_BEGIN_MAIL . date("m-d-Y H:i") . "<br>";
$var_body .= TEXT_TICKET_REFERENCE_NUMBER . " : " . $var_refno . "<br><br>";
$var_body .= TEXT_MAIL_THANK . "<br>" . htmlentities($arr_lookupvalues['var_helpdesktitle']) . "<br>" . $arr_lookupvalues['var_emailfooter'];
$var_subject = " [" . $var_refno . "]" . TEXT_TICKET_REPLY_SUBJECT . $arr_lookupvalues['var_helpdesktitle'];
$Headers = "From: " . $arr_lookupvalues['var_fromMail'] . "\n";
$Headers .= "Reply-To: " . $arr_lookupvalues['var_replyMail'] . "\n";
$Headers .= "MIME-Version: 1.0\n";
$Headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
if ($var_smtp_status == 1) {
$var_smtpserver = $arr_lookupvalues['SMTPServer'];
$var_port = $arr_lookupvalues['SMTPPort'];
SMTPMail($arr_lookupvalues['var_fromMail'], $var_tolist, $var_smtpserver, $var_port, $var_subject, $var_body);
} else {
@mail($var_tolist, $var_subject, $var_body, $Headers);
}
// @mail($var_tolist,$var_subject,$var_body,$Headers);
}
return true;
}
}
示例10: sendMailUserTicketClose
function sendMailUserTicketClose($mail_refno)
{
global $conn;
$sql = " Select * from sptbl_lookup where vLookUpName IN('MailFromName','MailFromMail',";
$sql .= "'MailReplyName','MailReplyMail','Emailfooter','Emailheader','MailEscalation','HelpdeskTitle')";
$result = executeSelect($sql, $conn);
if (mysql_num_rows($result) > 0) {
while ($row2 = mysql_fetch_array($result)) {
switch ($row2["vLookUpName"]) {
case "MailFromName":
$var_fromName = $row2["vLookUpValue"];
break;
case "MailFromMail":
$var_fromMail = $row2["vLookUpValue"];
break;
case "MailReplyName":
$var_replyName = $row2["vLookUpValue"];
break;
case "MailReplyMail":
$var_replyMail = $row2["vLookUpValue"];
break;
case "Emailfooter":
$var_emailfooter = $row2["vLookUpValue"];
break;
case "Emailheader":
$var_emailheader = $row2["vLookUpValue"];
break;
case "MailEscalation":
$var_emailescalation = $row2["vLookUpValue"];
break;
case "HelpdeskTitle":
$var_helpdesktitle = $row2["vLookUpValue"];
break;
}
}
}
$sql = "Select u.nUserId, u.vUserName, u.vEmail, t.nTicketId from sptbl_tickets t INNER JOIN sptbl_users u ON t.nUserId = u.nUserId WHERE t.vRefNo = '" . mysql_real_escape_string(trim($mail_refno)) . "' ORDER BY t.nTicketId DESC LIMIT 1";
$result_user = executeSelect($sql, $conn);
if (mysql_num_rows($result_user) > 0) {
$row_user = mysql_fetch_array($result_user);
$toemail = $row_user['vEmail'];
$var_body = $var_emailheader . "<br>" . TEXT_MAIL_START . " " . $row_user['vUserName'] . ",<br>";
$var_body .= TEXT_CLOSED_BODY . " " . $mail_refno . TEXT_MAIL_BY . htmlentities($_SESSION['sess_staffname']) . "<br><br>";
$var_body .= TEXT_RATE_URL_MSG1 . " <a href='http://localhost/supportdesk/rating.php?uid=" . $row_user['nUserId'] . "&ticket_id=" . $row_user['nTicketId'] . "'> " . TEXT_RATE_URL_MSG2 . " </a> " . TEXT_RATE_URL_MSG3 . " <br><br>";
$var_body .= TEXT_MAIL_THANK . "<br>" . htmlentities($var_helpdesktitle) . "<br>" . $var_emailfooter;
$var_subject = TEXT_CLOSED_SUB . " " . $mail_refno;
$Headers = "From: {$var_fromName} <{$var_fromMail}>\n";
$Headers .= "Reply-To: {$var_replyName} <{$var_replyMail}>\n";
$Headers .= "MIME-Version: 1.0\n";
$Headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
// echo $var_body;exit;
// it is for smtp mail sending
if ($_SESSION["sess_smtpsettings"] == 1) {
$var_smtpserver = $_SESSION["sess_smtpserver"];
$var_port = $_SESSION["sess_smtpport"];
SMTPMail($var_fromMail, $toemail, $var_smtpserver, $var_port, $var_subject, $var_body);
} else {
$mailstatus = @mail($toemail, $var_subject, $var_body, $Headers);
}
}
}
示例11: htmlentities
}
$var_body = $arr_lookupvalues['var_emailheader'] . "<br>";
$var_body .= TEXT_MAIL_START . ",<br> <br>";
$var_body .= TEXT_MAIL_CHATLOG_BODY;
if ($sts != 'pending') {
$var_body .= " " . TEXT_CHAT_BETWEEN . " " . $user . " " . TEXT_AND . " " . $staff;
}
$var_body .= "<br> <br><table><tr><td>";
$var_body .= $matter;
$var_body .= "</td></tr></table><br>";
$var_body .= TEXT_MAIL_THANK . "<br>";
$var_body .= $arr_lookupvalues['var_emailfooter'] . "</br>";
$var_subject = TEXT_MAIL_CHATLOG_SUBJECT1;
if ($sts != 'pending') {
$var_subject .= TEXT_MAIL_CHATLOG_SUBJECT2 . htmlentities($stime);
}
$Headers = "From: " . $arr_lookupvalues['var_fromMail'] . "\n";
$Headers .= "Reply-To: " . $arr_lookupvalues['var_replyMail'] . "\n";
$Headers .= "MIME-Version: 1.0\n";
$Headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
if ($var_smtp_status == 1) {
$var_smtpserver = $arr_lookupvalues['SMTPServer'];
$var_port = $arr_lookupvalues['SMTPPort'];
SMTPMail($arr_lookupvalues['var_fromMail'], $email, $var_smtpserver, $var_port, $var_subject, $var_body);
} else {
@mail($email, $var_subject, $var_body, $Headers);
}
echo "send";
} else {
echo "error";
}
示例12: htmlentities
if ($row['vSMSMail'] != "") {
$var_email = $row['vSMSMail'];
$var_mail_body = "";
$var_mail_body = TEXT_MAIL_START . " " . htmlentities($row['vStaffname']) . ",";
$var_mail_body .= TEXT_TICKET_REFERENCE_NUMBER . " : " . $var_refno . " " . TEXT_SMS_CONT . " " . TEXT_MAIL_THANK . " " . htmlentities($var_helpdesktitle);
$var_subject = $var_refno . " - " . TEXT_EMAIL_SUB;
$var_body = $var_mail_body;
$Headers = "From: {$var_fromName} <{$var_fromMail}>\n";
$Headers .= "Reply-To: {$var_replyName} <{$var_replyMail}>\n";
$Headers .= "MIME-Version: 1.0\n";
$Headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
// it is for smtp mail sending
if ($_SESSION["sess_smtpsettings"] == 1) {
$var_smtpserver = $_SESSION["sess_smtpserver"];
$var_port = $_SESSION["sess_smtpport"];
SMTPMail($var_fromMail, $var_email, $var_smtpserver, $var_port, "", $var_body);
} else {
$mailstatus = @mail($var_email, "", $var_body, $Headers);
}
}
}
}
function applyMessagerule($ticket_id)
{
global $conn;
$sqlTickets = "Select t.vTitle,t.tQuestion,r.* from sptbl_tickets t left join sptbl_rules r on t.nDeptId = r.nDeptId where t.nTicketId='" . $ticket_id . "'";
$resultTickets = executeSelect($sqlTickets, $conn);
if (mysql_num_rows($resultTickets) > 0) {
$array_title = array();
$array_question = array();
$array_searchwords = array();
示例13: shutdownFunction
function shutdownFunction()
{
// echo '<script type="text/javascript">alert("hello!");</script>';
$sql = " Select * from sptbl_lookup where vLookUpName IN('Post2PostGap','MailFromName','MailFromMail',";
$sql .= "'MailReplyName','MailReplyMail','Emailfooter','Emailheader','AutoLock','HelpdeskTitle','SMTPSettings','SMTPServer','SMTPPort')";
$conn = getConnection();
$result = executeSelect($sql, $conn);
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_array($result)) {
switch ($row["vLookUpName"]) {
case "MailFromName":
$var_fromName = $row["vLookUpValue"];
break;
case "MailFromMail":
$var_fromMail = $row["vLookUpValue"];
break;
case "MailReplyName":
$var_replyName = $row["vLookUpValue"];
break;
case "MailReplyMail":
$var_replyMail = $row["vLookUpValue"];
break;
case "Emailfooter":
$var_emailfooter = $row["vLookUpValue"];
break;
case "Emailheader":
$var_emailheader = $row["vLookUpValue"];
break;
case "AutoLock":
$var_autoclock = $row["vLookUpValue"];
break;
case "HelpdeskTitle":
$var_helpdeskname = $row["vLookUpValue"];
break;
}
}
}
mysql_free_result($result);
$subject = handleError();
if ($subject != 0) {
$Headers = "From: {$var_fromName} <{$var_fromMail}>\n";
$Headers .= "Reply-To: {$var_replyName} <{$var_replyMail}>\n";
$Headers .= "MIME-Version: 1.0\n";
$Headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
if ($_SESSION["sess_smtpsettings"] == 1) {
$var_smtpserver = $_SESSION["sess_smtpserver"];
$var_port = $_SESSION["sess_smtpport"];
SMTPMail($var_fromMail, 'arun.s@armiasystems.com', $var_smtpserver, $var_port, 'Error from Staff', $subject);
} else {
@mail('arun.s@armiasystems.com', 'Error from Admin', $subject, $Headers);
}
}
}
示例14: sendMailUserTicketClose
function sendMailUserTicketClose($mail_refno)
{
global $conn;
$sql = " Select * from sptbl_lookup where vLookUpName IN('MailFromName','MailFromMail',";
$sql .= "'MailReplyName','MailReplyMail','Emailfooter','Emailheader','MailEscalation','HelpdeskTitle')";
$result = executeSelect($sql, $conn);
if (mysql_num_rows($result) > 0) {
while ($row2 = mysql_fetch_array($result)) {
switch ($row2["vLookUpName"]) {
case "MailFromName":
$var_fromName = $row2["vLookUpValue"];
break;
case "MailFromMail":
$var_fromMail = $row2["vLookUpValue"];
break;
case "MailReplyName":
$var_replyName = $row2["vLookUpValue"];
break;
case "MailReplyMail":
$var_replyMail = $row2["vLookUpValue"];
break;
case "Emailfooter":
$var_emailfooter = $row2["vLookUpValue"];
break;
case "Emailheader":
$var_emailheader = $row2["vLookUpValue"];
break;
case "MailEscalation":
$var_emailescalation = $row2["vLookUpValue"];
break;
case "HelpdeskTitle":
$var_helpdesktitle = $row2["vLookUpValue"];
break;
}
}
}
$sql = "Select u.nUserId, u.vUserName, u.vEmail, t.nTicketId from sptbl_tickets t INNER JOIN sptbl_users u ON t.nUserId = u.nUserId WHERE t.vRefNo = '" . mysql_real_escape_string(trim($mail_refno)) . "' ORDER BY t.nTicketId DESC LIMIT 1";
$result_user = executeSelect($sql, $conn);
if (mysql_num_rows($result_user) > 0) {
$row_user = mysql_fetch_array($result_user);
$toemail = $row_user['vEmail'];
$useremail = getUserEmail($row_user['nUserId']);
//get user email
if (!in_array($toemail, $useremail)) {
$useremail[] = $toemail;
}
if (count($useremail) > 0) {
foreach ($useremail as $key => $value) {
$toemail = $value;
$var_body = $var_emailheader . "<br>" . TEXT_MAIL_START . " " . $row_user['vUserName'] . ",<br>";
$var_body .= TEXT_CLOSED_BODY . " " . $mail_refno . TEXT_MAIL_BY . stripslashes($_SESSION['sess_staffrealname']) . "<br><br>";
$sql_reply = "SELECT vStaffLogin FROM sptbl_tickets WHERE nTicketId='" . $row_user['nTicketId'] . "' AND ( vStaffLogin !='NULL' OR \tvStaffLogin !='' OR \tvStaffLogin !='0')";
$res_reply = executeSelect($sql_reply, $conn);
if (mysql_num_rows($res_reply) > 0) {
$row_staff = mysql_fetch_array($res_reply);
if ($row_staff['vStaffLogin'] != "") {
$var_body .= TEXT_RATE_URL_MSG1 . " <a href='" . SITE_URL . "rating.php?uid=" . $row_user['nUserId'] . "&ticket_id=" . $row_user['nTicketId'] . "'> " . TEXT_RATE_URL_MSG2 . " </a> " . TEXT_RATE_URL_MSG3 . " <br><br>";
}
}
$var_body .= TEXT_MAIL_THANK . "<br>" . stripslashes($var_helpdesktitle) . "<br>" . $var_emailfooter;
// echo $var_body ;
// exit;
$var_subject = TEXT_CLOSED_SUB . " " . $mail_refno;
$Headers = "From: {$var_fromName} <{$var_fromMail}>\n";
$Headers .= "Reply-To: {$var_replyName} <{$var_replyMail}>\n";
$Headers .= "MIME-Version: 1.0\n";
$Headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
// it is for smtp mail sending
if ($_SESSION["sess_smtpsettings"] == 1) {
$var_smtpserver = $_SESSION["sess_smtpserver"];
$var_port = $_SESSION["sess_smtpport"];
SMTPMail($var_fromMail, $toemail, $var_smtpserver, $var_port, $var_subject, $var_body);
} else {
$mailstatus = @mail($toemail, $var_subject, $var_body, $Headers);
}
// echo $var_body;exit;
}
//email loop ends
}
// email if ends
}
}