Jump to content

Mail Help


Clinton

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.