PHP Mail function not working on Web Services -
i using 2 different servers dev site , live site. webservice function send email confirmation working on dev site not working in live site. email confirmation function is:
function getemailconfirmation($username, $checklistid,$userid,$answerbulkid, $totalsubmitted){ if ( ($userid == '') || (!isset($userid)) ) { return error("partial"); } $entry = new entry(); $entry_date_check = date('y-m-d'); //for check if $count_tbl_answers = $entry->listentry("select count(*) total_from_answers tbl_answers user_id='".$userid."' , answer_bulk_id ='".$answerbulkid."' , date(ent_date) = '".$entry_date_check."' "); $to = "****@gmail.com"; $subject = "tdl checklist email"; $message = "hello there! \n user id: ".$userid." \n user name: ".$username."\n check list id: ".$checklistid."\n answer bulk id: ".$answerbulkid; $from = "tld-email-confirmation"; $headers = "from:" . $from; if(($count_tbl_answers[0]['total_from_answers']) == $totalsubmitted){ mail($to,$subject,$message,$headers); $result = array( "user_id" => $userid, "user_name" => $username, "check_list_id" => $checklistid, "answer_bulk_id" => $answerbulkid, ); } else{ $delete_bulk = $entry->query("delete tbl_answerbulk user_id ='".$userid."' , check_list_id ='".$checklistid."' , id ='".$answerbulkid."' "); $delete_answer = $entry->query("delete tbl_answers user_id='".$userid."' , answer_bulk_id ='".$answerbulkid."' "); return error("custom","","could not submit answer time. please try again later."); } $message = json_encode( $result ); $fin_data['response'] = json_encode(array('message'=>'ok','data'=>$message)); return $fin_data; }
this function works on dev server, not work on live server. might reason?
note: although mail function not working on live site, returns result array after mail function. is:
@mail($to,$subject,$message,$headers); $result = array( "user_id" => $userid, "user_name" => $username, "check_list_id" => $checklistid, "answer_bulk_id" => $answerbulkid, );
i tried ini_set('smtp_port', 587);
, @mail($to,$subject,$message,$headers);
not worked.
Comments
Post a Comment