title: Delay sending email in phpMailer
body: <p>I was just thinking of creating a reminder page where any user can enter his email, name, subject and a date so that an email will be send to him one day earlier than the date selected.</p>
  
  <p>I need to use phpMailer since I'm using it for all of my contact forms.</p>
  
  <p>Is there a way to delay sending an email based on the user's input in the date section?</p>
  
  <h2>*Update</h2>
  
  <p>My fears caught up to me, it appears I have no other choice than to use a Cron job, ok, fine then. (or not so fine since I haven't done it before)</p>
  
  <p>I create a cron job that runs my script every day at 12:30</p>
  
  <pre><code>30 12 * * * php path/to/some/phpscript.php
  </code></pre>
  
  <p>Using cPanel
  <a href="https://i.stack.imgur.com/6H3vM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6H3vM.jpg" alt="enter image description here"></a></p>
  
  <p>But say one user wants to be emailed on 24th of March 2016, so his input will be like <code>24/3/2016</code></p>
  
  <p>How do I check today's date to see if it's one day before the user's specified date, and if it is, run the PHP mailer script.</p>
  
  <h2>*Last Edit with working solution</h2>
  
  <p>I made two pages, one that has a comment form with a datepicker, another that lists the comments and goes through all of them, checks to see if current date == datepicker then hit phpMailer with the fields in the comment as subject, recipient and so on. Then made a cron job to access the page everyday at 7:30 and it's working like a charm !</p>