Clinton Posted October 15, 2007 Share Posted October 15, 2007 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>"); } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/73386-mail-help/ Share on other sites More sharing options...
darkfreaks Posted October 15, 2007 Share Posted October 15, 2007 try something like this <?php $headers = "Content-Type: text/html; charset=iso-8859-1\n"; $body = "<html>"; $body .= "<head>"; # more message $body .= "</html>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/73386-mail-help/#findComment-370257 Share on other sites More sharing options...
Clinton Posted October 15, 2007 Author Share Posted October 15, 2007 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."; Quote Link to comment https://forums.phpfreaks.com/topic/73386-mail-help/#findComment-370260 Share on other sites More sharing options...
darkfreaks Posted October 15, 2007 Share Posted October 15, 2007 try what i posted above 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>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/73386-mail-help/#findComment-370262 Share on other sites More sharing options...
Clinton Posted October 16, 2007 Author Share Posted October 16, 2007 I did that and it sent the e-mail but there was no text. Instead there was two .dat files attached to the e-mail. ???? Quote Link to comment https://forums.phpfreaks.com/topic/73386-mail-help/#findComment-370465 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.