ngreenwood6 Posted September 9, 2008 Share Posted September 9, 2008 I have set-up an email link to reset the users password. I have this code for the subject: $message = "Please <a href='reset.php?email=$reset_email'>click here</a> to reset your password."; It sends the email but the problem is that it doesnt show it as a link as click here. It just shows the code. Anyone know how to get it to show the link in an email? Link to comment https://forums.phpfreaks.com/topic/123515-email-links/ Share on other sites More sharing options...
lisa71283 Posted September 9, 2008 Share Posted September 9, 2008 HTML requires double quotes. Replace the single quotes (') with double quotes ("). You will have to escape them (\") as they will be appearing within a double quote enclosed string. Link to comment https://forums.phpfreaks.com/topic/123515-email-links/#findComment-637868 Share on other sites More sharing options...
pocobueno1388 Posted September 9, 2008 Share Posted September 9, 2008 HTML requires double quotes. Replace the single quotes (') with double quotes ("). You will have to escape them (\") as they will be appearing within a double quote enclosed string. That shouldn't be the problem. Are you sending a header? $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; Then your mail function should look something like mail($to, $subject, $message, $headers); Link to comment https://forums.phpfreaks.com/topic/123515-email-links/#findComment-637877 Share on other sites More sharing options...
ngreenwood6 Posted September 9, 2008 Author Share Posted September 9, 2008 You cant use html inside of php with double quotes for the first response. The second response is yes I am using the headers but it is showing the link but the full link and not the click here as the link if that makes sense. Link to comment https://forums.phpfreaks.com/topic/123515-email-links/#findComment-637882 Share on other sites More sharing options...
lisa71283 Posted September 9, 2008 Share Posted September 9, 2008 When you say "subject", are you referring to the subject of the email? HTML code should not be in the subject of an email, only the body. Link to comment https://forums.phpfreaks.com/topic/123515-email-links/#findComment-637885 Share on other sites More sharing options...
dezkit Posted September 9, 2008 Share Posted September 9, 2008 [logic] $message = "Please <a href=\"http://www.site.com/reset.php?email=$reset_email\">click here</a> to reset your password."; [/logic] Link to comment https://forums.phpfreaks.com/topic/123515-email-links/#findComment-637887 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.