frank_solo Posted November 4, 2011 Share Posted November 4, 2011 This is a partial script but I can't get the hyperlink. It shows the whole code instead of just showing "link" as a link. $email=$_POST['email']; $password=$_POST['password1']; $username=$_POST['username']; $to=$email; // Your subject $subject="My Website - Your login info"; // From $header="from: Mywebsite<webmaster@mywebsite.com>"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Your message $message="This is your log in information: \r\n"; $message.=" Username: $username \r\n"; $message.=" Password: $password \r\n"; $message.="Click on <a href=\"http://www.mywebsite.com\">link</a> and login to start posting."; // send email $sentmail = mail($to,$subject,$message,$header); Quote Link to comment https://forums.phpfreaks.com/topic/250441-how-do-insert-a-hyperlink-in-message-php/ Share on other sites More sharing options...
Adam Posted November 4, 2011 Share Posted November 4, 2011 You're not sending $headers to mail(), you're sending $header. Meaning the email is rendered as plain text, because you're not passing the HTML content-type MIME header. Quote Link to comment https://forums.phpfreaks.com/topic/250441-how-do-insert-a-hyperlink-in-message-php/#findComment-1284935 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.