Jump to content

Recommended Posts

I'm trying to get the html to show in the e-mail (so 'here' is highlighted and they can click on it) but instead it just shows the link. I've tried a couple of things but am getting errors. How do I go about doing this? Thank you.

 

<?

$query = "UPDATE users SET First='$first', MI='$mi', Last='$last', Phone='$homephone', Email='$email', CellPhone='$CellPhone', Username='$username', Status='$status' WHERE ID='$id'";
$result = mysql_query($query)or die(mysql_error());

$to = "$email";
$subject = "Your California Office Database Registration";
$body = "Hi, $first $last. Your access to the California Office Database has been modified. Logon <a href='test.php'>here</a> to view your status.";
if (mail($to, $subject, $body)) {
echo("<p>An e-mail to the user has gone out. <a href='index.php'>Return</a><br></p>");
} else {
echo("<p>The e-mail FAILED to go out.</p>");
echo("The registration information has been updated. <a href='index.php'>Return</a><br>");
}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/73386-mail-help/
Share on other sites

Well for the code I posted there is no errors. It just shows the link address instead of making it hyper. I want to be able to click on it. I tried stopping the php code ?> and starting it after some html <?... oh I just tried to change it again and I"m not getting errors but it's just posting the code:

 

This is what showed up in my e-mail when I tried to start and stop code:

 

Logon ?> <a href='http://test'>here</a> <?to view your status.";

Link to comment
https://forums.phpfreaks.com/topic/73386-mail-help/#findComment-370260
Share on other sites

try what i posted above ;D

 

 

then in your mail statement

<?php
mail($to,$subject,$body,$headers); //// note change $message to $body?>

 

 

<?php

$headers  = "Content-Type: text/html; charset=iso-8859-1\n";
$body  = "<html>";
$body .= "Hi, $first $last. 
Your access to the California Office Database has been modified.
Logon <a href='test.php'>here</a> to view your status.";
$body .= "</html>";

?>

Link to comment
https://forums.phpfreaks.com/topic/73386-mail-help/#findComment-370262
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.