FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Placing an URL in email
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Placing an URL in email [message #171748 is a reply to message #171747] Thu, 20 January 2011 08:07 Go to previous messageGo to previous message
jwcarlton is currently offline  jwcarlton
Messages: 76
Registered: December 2010
Karma:
Member
On Jan 20, 2:09 am, Michael Fesser <neti...@gmx.de> wrote:
> .oO(jwcarlton)
>
>> 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".
>
> This must be a bug in your code.
>
> Micha

Here's what I'm using:

$to = "sales(at)example(dot)com";
$subject = "Test";

$headers = "From: $user<$user(at)example(dot)com>\n";
$headers .= "build-To: <$user(at)example(dot)com>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/related; ";
$headers .= "type=\"multipart/alternative\"; ";
$headers .= "boundary=\"----=MIME_BOUNDRY_main_message\"\n";
$headers .= "X-Sender: $user<$user(at)example(dot)com>\n";
$headers .= "X-Mailer: PHP4\n";
$headers .= "X-Priority: 1\n"; //1 = Urgent, 3 = Normal
$headers .= "Return-Path: <$user(at)example(dot)com>\n";
$headers .= "This is a multi-part message in MIME format.\n";
$headers .= "------=MIME_BOUNDRY_main_message \n";
$headers .= "Content-Type: multipart/alternative; ";
$headers .= "boundary=\"----=MIME_BOUNDRY_message_parts\"\n";

$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);
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: hack
Next Topic: Using a heredoc in PHP as in Perl
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 11:52:25 GMT 2024

Total time taken to generate the page: 0.07247 seconds