|
|
|
Re: Placing an URL in email [message #171884 is a reply to message #171748] |
Thu, 20 January 2011 08:23 |
alvaro.NOSPAMTHANX
Messages: 277 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
El 20/01/2011 9:07, jwcarlton escribió/wrote:
> Here's what I'm using:
[...]
> $message = "------=MIME_BOUNDRY_message_parts\n";
> $message .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
> $message .= "Content-Transfer-Encoding: quoted-printable\n";
^^^^^^^^^^^^^^^^
> $message .= "\n";
>
> $message .= "<a href='http://www.example.com/whatever/?
> action=something&id=4300'>\n";
> $message .= "http://www.example.com/whatever/?
> action=something&id=4300\n";
> $message .= "</a>";
>
> $message .= "\n";
> $message .= "------=MIME_BOUNDRY_message_parts--\n";
> $message .= "\n";
>
> mail($to, $subject, $message, $headers);
You declare the encoding as quoted printable but you never encode it.
I'd expect to see quoted_printable_encode() somewhere.
Also, in HTML you must use & to insert literal ampersands. Have a
look at htmlspecialchars().
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
|
|
|
Re: Placing an URL in email [message #171896 is a reply to message #171740] |
Thu, 20 January 2011 13:36 |
Peter H. Coffin
Messages: 245 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On Wed, 19 Jan 2011 18:12:16 -0800 (PST), jwcarlton wrote:
> I'm sending an HTML email through PHP, and the email includes a
> website link. Like so:
>
> <a href="http://www.example.com/whatever/?action=something&id=4300">
> http://www.example.com/whatever/?action=something&id=4300
> </a>
>
> The problem I'm having is that the link is showing up in the email
> like this:
>
> http://www.example.com/whatever/?action=something&id300
>
> Notice the last variable is "id300" instead of "id=4300".
>
> I've tried using urlencode(), and while this does fix the actual link,
> the displayed URL has the coded symbols. What function should I be
> using to show the website link correctly?
Turn off quoted-printable in your MIME encoding. If you're sending HTML,
you don't need it anyway. Proper HTML is already 7-bit clean.
--
67. No matter how many shorts we have in the system, my guards will be
instructed to treat every surveillance camera malfunction as a
full-scale emergency.
--Peter Anspach's list of things to do as an Evil Overlord
|
|
|
|
Re: Placing an URL in email [message #171909 is a reply to message #171899] |
Thu, 20 January 2011 20:48 |
Peter H. Coffin
Messages: 245 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On Thu, 20 Jan 2011 16:45:58 +0100, ?lvaro G. Vicario wrote:
> El 20/01/2011 14:36, Peter H. Coffin escribi?/wrote:
>> Turn off quoted-printable in your MIME encoding. If you're sending HTML,
>> you don't need it anyway. Proper HTML is already 7-bit clean.
>
> Where did you get such idea? Even the W3C uses UTF-8 in their own site.
>
> http://www.w3.org/
Okay "can be 7-bit clean". Happier?
The point being that there are more than enough ampersand entitites that
there's no reason that anyone would need to bother with hex-encoding
anything to enable safe SMTP transit in the message body. Since
quoted-printable is Causing A Problem, ditching that is the easy
solution to the problem. Rewriting an application in order to make
different URLs seems like far more work.
--
We're the technical experts. We were hired so that management could
ignore our recommendations and tell us how to do our jobs.
-- Mike Andrews
|
|
|
Re: Placing an URL in email [message #171947 is a reply to message #171909] |
Sat, 22 January 2011 11:36 |
Tuz Mwaura
Messages: 1 Registered: January 2011
Karma: 0
|
Junior Member |
|
|
On Jan 20, 11:48 pm, "Peter H. Coffin" <hell...@ninehells.com> wrote:
> On Thu, 20 Jan 2011 16:45:58 +0100, ?lvaro G. Vicario wrote:
>> El 20/01/2011 14:36, Peter H. Coffin escribi?/wrote:
>>> Turn off quoted-printable in your MIME encoding. If you're sending HTML,
>>> you don't need it anyway. Proper HTML is already 7-bit clean.
>
>> Where did you get such idea? Even the W3C uses UTF-8 in their own site.
>
>> http://www.w3.org/
>
> Okay "can be 7-bit clean". Happier?
>
> The point being that there are more than enough ampersand entitites that
> there's no reason that anyone would need to bother with hex-encoding
> anything to enable safe SMTP transit in the message body. Since
> quoted-printable is Causing A Problem, ditching that is the easy
> solution to the problem. Rewriting an application in order to make
> different URLs seems like far more work.
>
> --
> We're the technical experts. We were hired so that management could
> ignore our recommendations and tell us how to do our jobs.
> -- Mike Andrews
Try this line in your code
<a href="http://www.example.com/whatever/?action=something&id=
\"4300\" ">
http://www.example.com/whatever/?action=something &id=\"4300\" </a>
|
|
|
|