I am using Joomla 1.5 and I would like to know if my mail will be sent if I run the function after redirect();
My code is as below:
$callback = new stdClass();
$callback->LeaveID = $leaveid;
$callback->callback = 1;
$callback->balance_cf = $balance_cf;
$callback->remarks = $remarks;
if($db->updateObject('#__leaves',$callback,'LeaveID')) {
$app->redirect($url,' Callback Perfomed Successfully');
}
else {
echo 'Not saved - Leave App';
}
mail($user->email,$somesubject,$message,implode("\r\n",$headers));`
Will the mail function be executed if the $db->updateObject()
returns true
?
mail()
function after the redirect? Can you not put it inside theif
statement and redirect if the mail if successful?if(){}
blockif
statementmail()
using up all the resources before trying theupdate
..that's why am running itafter