title: PHP: How to send confirmation mail by clicking link in existing mail?
body: <p>When a customer sends an appointment request the service provider gets an email. I want to include a link in this email, which would trigger an email that would be sent directly to customer.</p>
  
  <p>Following code just opens the blank page in browser when the link in the email is clicked and the email is not sent. What am I doing wrong?</p>
  
  <pre><code>&lt;a href='?confirmation'&gt;Confirm appointment request&lt;/a&gt;
  
  &lt;?php
  function confirmFunction() {
      $to = $appointment-&gt;get_order()-&gt;billing_email;
      $subject = 'Appointment confirmed';
      $msg = "Appointment confirmed.\n";
      mail($to, $subject, $msg);
  }
  
  if (isset($_GET['confirmation'])) {
      confirmFunction();
  }
  ?&gt;
  </code></pre>