title: If statement is not working in phpmailer service
body: <p>I'm setting a phpmailer service in which I'm just sending a link access to some users. The service works perfectly. My problem comes out when I set a IF statement and it doesn't validate. I just want that it can enter to the if validation. The validation to make is when, $result=='s' is true, send the mail, else ($result=='n'), do nothing.</p>
  <p>I've researched a lot about this error, obviously not solution found.
  This is for a mobile app built in ionic 3 with TypeScript and PHP services in Apache server. Also I use a connection to a MySQL DB.</p>
  <pre><code>{
  &lt;?php
  
  $postdata = file_get_contents(&quot;php://input&quot;);
  $request = json_decode($postdata);
  header('Content-type: application/json');
  header(&quot;Access-Control-Allow-Origin: *&quot;);
  header('Access-Control-Allow-Headers: X-Requested-With, content-type, access-control-allow-origin, access-control-allow-methods, access-control-allow-headers');
  
  include('conecction.php');
  
  
  use PHPMailer\PHPMailer\PHPMailer;
  use PHPMailer\PHPMailer\Exception;
  
  require 'phpMailer/src/Exception.php';
  require 'phpMailer/src/PHPMailer.php';
  require 'phpMailer/src/SMTP.php';
  
  
  $id =$request-&gt;id;
  
  
  $counting = count($request-&gt;people);
  
  for($i=0;$i&lt;$counting ;$i++){
  
      $name=$request-&gt;people[$i]-&gt;name;
      $email=$request-&gt;people[$i]-&gt;mail;
      $hash=md5($id.$email);
  
  $sql=&quot;select assisted from assistance where mail= '$email' and idmeeting = '$id'&quot;;
  
  $result = $conn-&gt;query($sql);
  
   if($result == 's'){
  
  $mail = new PHPMailer;
    
  $mail-&gt;SMTPDebug = 4; 
     
  $mail-&gt;setFrom('noresponder@Prueba.com', 'Prueba MeetCoomeva');
  $mail-&gt;addAddress($email, $name); 
  
  
  $mail-&gt;Subject = 'Subject'; 
  
  $mail-&gt;Body    = &quot;Message Body &quot;
  
  }
  if ($mail-&gt;send()) {
   $response['message']=&quot;Sent.&quot;;
  } else { 
     echo &quot;Sending error: &quot; . $mail-&gt;ErrorInfo;
  }
  }
  echo json_encode($response);
  ?&gt;
  }
  </code></pre>
  <p>I want the service compose and send the mail when it have made the validation $result=='s'</p>
  <p>I getting a 500 server internal error just by this. I just want it sends the mail when the validation is true or do nothing when entered in else.</p>