title: Send mail via out.php in order to track clicks of a button
body: <p>I need to track a button every time someone clicks on it. I created a file "out.php" to send me an email and redirect to a link outside my page. This code redirects but the mail doesn't send.</p>
  
  <pre><code>&lt;div class="buyprod"&gt;
  &lt;a target="_blank" href="http://xxx.com/out.php?url=&lt;?php echo urlencode($this-&gt;product['from'])?&gt;"&gt;
  &lt;img src="http://xxx.com/buybtn.jpg" alt="buy"/&gt;
  &lt;/a&gt;
  &lt;/div&gt;  
  </code></pre>
  
  <p>out.php</p>
  
  <pre><code>&lt;?php
  $url = urldecode($_GET['url']);
  header("Location: ".$url);
  $message = "Someone clicked buy: ";
  $link = $this-&gt;product['from'];
  mail('xxx@xxx.com', '@Buy', $message.$link);
  exit;
  </code></pre>
  
  <p>Anyone knows what's wrong with this code?
  Thanks in advance!</p>