Brandt
07-18-2008, 05:02 PM
I have an e-mail script setup which outputs links depending on what options someone selects from a web form. Lately, I have been seeing junk output coming from my variable. For instance, one of the links that is outputted displays in the e-mail as:
http://files.bran!%0a+dtalexander.com/pdf/newsletter1.pdf
It is inserting the '!%0a+' from somewhere and I cannot figure out where.
I am using simple if statements to build a $msg variable:
if ($item1==true) { $msg = "http://files.brandtalexander.com/pdf/newsletter1.pdf"; }
if ($item2==true) { $msg .= "http://files.brandtalexander.com/pdf/newsletter2.pdf"; }
and so on...
My email code is:
$headers = "From: $email\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
mail($to, $hostsub, $hostmsg, $headers);
I setup to have it echo the $msg and it is perfectly fine. The error only appears in the email itself. I have tested this with a variety of e-mail clients. What could be causing this? Thank you in advance.
http://files.bran!%0a+dtalexander.com/pdf/newsletter1.pdf
It is inserting the '!%0a+' from somewhere and I cannot figure out where.
I am using simple if statements to build a $msg variable:
if ($item1==true) { $msg = "http://files.brandtalexander.com/pdf/newsletter1.pdf"; }
if ($item2==true) { $msg .= "http://files.brandtalexander.com/pdf/newsletter2.pdf"; }
and so on...
My email code is:
$headers = "From: $email\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
mail($to, $hostsub, $hostmsg, $headers);
I setup to have it echo the $msg and it is perfectly fine. The error only appears in the email itself. I have tested this with a variety of e-mail clients. What could be causing this? Thank you in advance.