droidus Posted August 23, 2011 Share Posted August 23, 2011 why does this code not show the user a link, rather just what looks like a link?: // message $message = ' <html> <head> <title>Your New Account - Activation Required</title> </head> <body> <p>Please click on the link below to continue with activating your account:</p> <a href"http://www.mywebsite.com/verify?activationCode=$activationKey">Click here to activate your account.</a> <p> If you have received this message in error, please ignore this. </body> </html> '; Quote Link to comment Share on other sites More sharing options...
doddsey_65 Posted August 23, 2011 Share Posted August 23, 2011 Im assuming this is for an email. have you included the required headers? Can you show us the full code? Quote Link to comment Share on other sites More sharing options...
droidus Posted August 23, 2011 Author Share Posted August 23, 2011 here are the rest: // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: ' . $_POST['email'] . "\r\n"; $headers .= 'From: MySite <noreply@mysite.com>' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); Quote Link to comment Share on other sites More sharing options...
doddsey_65 Posted August 23, 2011 Share Posted August 23, 2011 I have had the same issue. I was using only one $message variable to hold the whole message and it wasnt displaying the html in the message. Try seperating the message and using multiple $message instances. $message = '<html><head>'; $message .= '<title>Your New Account - Activation Required</title>'; $message .= '</head><body>'; $message .= '<p>Please click on the link below to continue with activating your account:</p>'; $message .= '<a href"http://www.mywebsite.com/verify?activationCode=$activationKey">Click here to activate your account.</a>'; $message .= '<p>If you have received this message in error, please ignore this.</p>'; $message .= '</body></html>'; Quote Link to comment Share on other sites More sharing options...
droidus Posted August 23, 2011 Author Share Posted August 23, 2011 nope; still doesn't work Quote Link to comment Share on other sites More sharing options...
doddsey_65 Posted August 23, 2011 Share Posted August 23, 2011 Im not sure but the inclusion of the <html><head> <title> and <body> tags may be an issue. Remove them and just use basic html tags like <p> and headings. Quote Link to comment Share on other sites More sharing options...
droidus Posted August 23, 2011 Author Share Posted August 23, 2011 i tried just the link, and it didn't work Quote Link to comment Share on other sites More sharing options...
doddsey_65 Posted August 23, 2011 Share Posted August 23, 2011 this is my last shot then. You have a variable appended to the end of the url link ( just noticed it ). if you include variables in quotes in php they need to be within double quotes so php can parse them. Quote Link to comment Share on other sites More sharing options...
Genesis730 Posted August 23, 2011 Share Posted August 23, 2011 You have $message .= '<a href"http://www.mywebsite.com/verify?activationCode=$activationKey">Click here to activate your account.</a>'; should be $message .= '<a href="http://www.mywebsite.com/verify?activationCode=$activationKey">Click here to activate your account.</a>'; You forgot the = in a href="... Quote Link to comment Share on other sites More sharing options...
droidus Posted August 24, 2011 Author Share Posted August 24, 2011 yea, lol the stupid mistakes i make at night Quote Link to comment 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.