I'm sending emails via mail()
that include an URL with a variable, that allows recipients to view filtered contents only.
$text_body= "anglebracket_a_href='https://example.com/list.php?var=$variable'">Link anglebracket/a>"
Variables are stored in a mysql database. Everything works fine so far, but the URL displays differently in every mail client.
Instead of the correct version:
<br>
https://www.example.com/list.php?var=76733d141
In Thunderbird it reads
<br>
tps://www.example.com/list.php?varv733d141*
(https truncated! and = sign and the first 2 digits turn into a v)
In Webmail it reads
<br>
https://www.example.com/list.php?varv733d141
In my iPhone mail app it displays correctly and the link is clickable and works!
These are my headers:
$recipient = "test@example.com";
$subject="Your Login Data for $var1 at $var2 in $var3";
$text ="";
$text .=$text_body;
$sender = "Test <noreply@example.com>";
$headers = array();
$headers[] = "MIME-Version: 1.0";
$headers[] = "Content-Type: text/HTML; charset=ISO-8859-1";
$headers[] = "Content-Transfer-Encoding: quoted-printable";
$headers[] = "From: {$sender}";
$headers[] = "Reply-To: {$sender}";
$headers[] = "Subject: {$subject}";
$headers[] = "X-Mailer: PHP/".phpversion();
mail($recipient, $subject, $text,implode("
",$headers));
Tried different encodings and delimiting and everything. Which basic or not so basic problem am I overlooking? Thanks for any help!