title: How to send email to multiple user email in PHP by set date and hour automatically
body: <p>I want to send email to multiple user email in PHP automatically by setting a date by the user I mean the user choose a date and hour from input date and I save it on a database then I want to send an email on that date is there any way to PHP do this job automatically because I do this job manually by myself and the number of users is going up and maybe we must send emails in any seconds of a day and I want to do this job in Laravel 5.8 framework when I success on it.</p>
  
  <p>The code I use in a PHP file and run this manually like this:</p>
  
  <p>(I get <code>$UsersEmail</code> array from a database by selecting the date and hour and it's like the array I write in codes).</p>
  
  <pre><code>$UsersEmail = array(
      0 =&gt; 'user1@example.com',
      1 =&gt; 'user2@site.com',
      2 =&gt; 'user3@test.com',
      3 =&gt; 'user4@somesite.com',
      4 =&gt; 'user5@anohtersite.com',
  );
  
  $AllEmail = '';
  
  foreach($UsersEmail as $user){
      $AllEmail .= $user.', ';
  }
  
  $to = $AllEmail;
  
  $subject = 'Send Email';
  
  $message = 'This is text message';
  
  $headers[] = 'MIME-Version: 1.0';
  $headers[] = 'Content-type: text/html; charset=utf-8';
  
  $headers[] = 'From: My site &lt;info@mysite.com&gt;';
  
  mail($to, $subject, $message, implode("\r\n", $headers));
  
  </code></pre>
  
  <p>and I want to do this job in Laravel5.8 framework in the future</p>
  
  <p>My PHP version is 7.2.7 and Laravel version I want to use in the future is 5.8.</p>