This error is a new security concern by Hostgator Server, they have disapproved user to send email from another domain name, except itself, for example if your website is hosted on server www.example.com then you cant send email from username@gmail.com or anyone else except <anyword>@example.com. See details for troubleshoot..



For troubleshooting this problem we have to, make ammendment in sendemail() function which is as follows :


 function sendemail($subject,$body,$customer_mail){
 
 require_once('mail.php');
// echo "sending";
   $mailbody=mail_header().$body.mail_footer();    
    $mail = new PHPMailer();
    $mail->Host = SMTP_HOST;
    $mail->From = REST_EMAIL;
    $mail->FromName = REST_NAME;
    
    
   // smtp function on 
   if(SMTP==true){
   
    $mail->IsSMTP();
    $mail->SMTPAuth=SMTP_AUTH;
    $mail->Port=SMTP_PORT;
    $mail->Username=SMTP_USERNAME;
    $mail->Password=SMTP_PASSWORD;
    $mail->Host = "Localhost";
   }
   // end of smtp function 
    
    
    $mail->Subject = $subject." - ".REST_EMAIL;
    $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; 
    $mail->MsgHTML($mailbody);
    if($customer_mail==""){
    $mail->AddAddress(REST_EMAIL);
    }else{
//    $mail->AddCC(SEND_COPY);
    $mail->AddAddress($customer_mail.",".SEND_COPY);
    }   

   
   
   if(BCC){
   $bcc = explode(",",BCC);
   foreach($bcc as $bccer){
    $mail->AddBCC($bccer);
   }
   }
   
   
   
   
    if($mail->Send()){
   
    }else{
    echo $mail->ErrorInfo;
    }
    
 }




alll the external email must go into 
    $mail->AddAddress($customer_mail.",".SEND_COPY);
and then all email will be send to them as mail all.

there will be certain Constant Variables

$mails=str_replace(" ","",$restaurant['report_email']);
define("SEND_COPY",$mails);

and 
define("REST_EMAIL","info@example.com");



and order_email.php file must be changed ..
receiptmail($act,$admin_content.$mailbody.$admin_content,REST_MAIL);
must be changed to
receiptmail($act,$admin_content.$mailbody.$admin_content,SEND_COPY);