title: What Content-Transfer-Encoding should I use when sending a PHP mail() containing a long http-link?
body: <p>I've got a script that sends e-mails that looks kinda like this:</p>
  
  <pre><code>$headers = "From: test@example.com\r\n";
  $headers .= "Reply-To: test@example.com\r\n";
  $headers .= "MIME-Version: 1.0\r\n";
  $headers .= "Content-type: text/plain; charset=utf-8\r\n";
  $headers .= "Content-Transfer-Encoding: 8bit";
  $orgsubject = "A subject with some swedish characters like å, ä and ö";
  $newsubject='=?UTF-8?B?'.base64_encode($orgsubject).'?=';
  $body = 'A lot of text.
  
  Some more text.
  
  A long URL:
  http://example.com/subpage/?id=1234&amp;hash=23jh4lk2j3h4lkjh674598xzxlk2j34h&amp;anotherhash=h2k3j4h23kh42kj34h2lk3';
  </code></pre>
  
  <p>It's tested thoroughly but some users, I think Outlook users, get a URL looking like this:
  <a href="http://example.com/subpage/?id=3D1234&amp;hash=3D3D23jh4lk2j3h4lkjh674598xzxlk2j34h&amp;anotherhash=3Dh2k3j4h23kh42kj34h2lk3" rel="nofollow noreferrer">http://example.com/subpage/?id=3D1234&amp;hash=3D3D23jh4lk2j3h4lkjh674598xzxlk2j34h&amp;anotherhash=3Dh2k3j4h23kh42kj34h2lk3</a>
  The equal signs is now followed by '3D' which makes the URL useless in my case. I guess this has something to do with the Content-Transfer-Encoding or perhaps the Content-type, do I need to encode the body message to base64 or something?</p>
  
  <h1>Update</h1>
  
  <p>Just found this forum post: <a href="https://stackoverflow.com/a/7289434/513321">https://stackoverflow.com/a/7289434/513321</a>
  So I removed the Content-Transfer-Encoding and it seems to work fine but on the other hand I could never reproduce the error where the URL contained the '3D' text, so I can't be certain that this will work. Does anyone know if removing the Content-Transfer-Encoding would solve my problem?</p>