Forum Moderators: coopster

Message Too Old, No Replies

MailMessage Bug when trying to send url?

MailMessage, sending an URL with variables.

         

KenvdBroek

2:16 pm on Apr 27, 2004 (gmt 0)

10+ Year Member



Hi there,

My first post here and what I saw when I received the "Registration Email - Action Required" was the solution for my question. Well, it was how I want it to look like, but I dont get it fixed.

I am trying to send an URL with variables.

The code looks like:

$url = "id=$comment_id&hash=$hash";
$MailMessage .= "$url\n";
...rest of code not relevant.

I get in my mailbox:

comment_id: 74
hash: ebb2384787bad310e20ff8cdeab382d9

id=hashëb2384787bad310e20ff8cdeab382d9

Anyone knows the solution here?

Thanks. Ken

jatar_k

5:16 pm on Apr 27, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld KenvdBroek,

what if you try doing it a little differently, though I don't see anything wrong right away. I would also try echoing the variable contents to make sure they all have the proper values.

echo '<p>id: ',$comment_id,'<br>hash: ',$hash;
$url = 'id=' . $comment_id . '&hash=' . $hash;
echo '<p>url: ',$url;
$MailMessage .= "$url\n";
echo '<p>mess: ',$MailMessage;

this way you show them before concatenation and after each step to confirm that they are correct all the way through.

KenvdBroek

10:29 am on Apr 29, 2004 (gmt 0)

10+ Year Member



Hmm. took me few hours but I fixed it.

What I did wrong was the way how I tried to send the email.

$headers .= "Content-type: multipart/mixed; ";
$message .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$message .= "Content-Transfer-Encoding: quoted-printable\n\n";

This did't work at all.

Now, it looks like:

<?
//mailmessage
$header = "From: $provider_name <$provider_email>\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: text/html;\n";
$header .= "Content-Transfer-Encoding: 7bit";
$onderwerp = "Please, activate your comment!";
$bericht = "Please visit the following url to activate your comment on the column of DJ Ken:<br>
<a href=\"".$domein."content.php?page=cactivate&id=".$comment_id."&hash=".$hash."\">
".$domein."content.php?page=cactivate&id=".$comment_id."&hash=".$hash."</a><br>
<br>
-------------<br>
<a href=\"".$domein."\">".$domein."</a>";
if(mail($email, $onderwerp, $bericht, $header))
{
?>