title: Link URL base disappearing when sent in a mail via PHP
body: <p>Whenever I send a mail via PHP (content generated by jQuery, AJAX <code>POST</code> to PHP) the base of the URL gets missing when arriving at the destination.</p>
  
  <p>So for instance, I send a mail with the following body:</p>
  
  <pre><code>Click &lt;a href="http://www.example.com/?u=parameter&amp;i=otherparameter"&gt;HERE&lt;/a&gt; to go to the login page, etc, etc..
  
  Use this link or copy it to your browser's address bar if the above doesn't work:
  &lt;a href="http://www.example.com/?u=parameter&amp;i=otherparameter"&gt;http://www.example.com/?u=parameter&amp;i=otherparameter&lt;/a&gt;
  </code></pre>
  
  <p>Which looks like this:</p>
  
  <p><em>Click <a href="http://www.example.com/?u=parameter&amp;i=otherparameter" rel="nofollow">HERE</a> to go to the login page, etc, etc..</em></p>
  
  <p><em>Use this link or copy it to your browser's address bar if the above doesn't work:
  <a href="http://www.example.com/?u=parameter&amp;i=otherparameter" rel="nofollow">http://www.example.com/?u=parameter&amp;i=otherparameter</a></em></p>
  
  <p><strong>But</strong>, the receiver gets the <em>same</em> text, only without the links' base URL..</p>
  
  <p>The link of <code>Click HERE</code> has the URL of only <code>/?u=parameter&amp;i=otherparameter</code>, same goes for the other link, but the text of that link is fine. So it goes to the page where the mail is opened and appends the parameters there. It looks like this:</p>
  
  <p><em>Click <a href="/?u=parameter&amp;i=otherparameter">HERE</a> to go to the login page, etc, etc..</em></p>
  
  <p><em>Use this link or copy it to your browser's address bar if the above doesn't work:
  <a href="/?u=parameter&amp;i=otherparameter">http://www.example.com/?u=parameter&amp;i=otherparameter</a></em></p>
  
  <p>As you can see, the link will be directed to <code>stackoverflow.com</code>, instead of <code>example.com</code>. What is happening that either jQuery, AJAX or PHP strips my HTML, or is it a clientside problem? </p>
  
  <p>(Tested in FF15/Chrome20/IE8, jQuery v1.7.2, PHP v5.3.5)</p>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is how I send the mail with PHP:</p>
  
  <pre><code>$to      = $_POST['t'];
  $subject = $_POST['s'];
  $message = $_POST['m'];
  
  $headers = "MIME-Version: 1.0" . "\r\n" . 
             "Content-type: text/html; charset=iso-8859-1" . "\r\n" . 
             "From: &lt;noreply@example.com&gt;" . "\r\n" .
             "X-Mailer: PHP/" . phpversion();
  
  mail($to, $subject, $message, $headers);
  </code></pre>