promotec Posted June 1, 2013 Share Posted June 1, 2013 Hi guys a simple php mail question, I am using the following mail routine to send a email from a script, its all working just fine except the <a href="">Click Here to View</a> is showing the code on the resulting email not just the hyperlinked Click Here to View. heres my code below I tried swapping content type header from text/html to multipart/alternative that didn't make any difference, any suggestion would be very helpful. $to = "$email"; $subject = "$name Your Free Reading From ClairVision Network"; //headers and subject $headers = "MIME-Version: 1.0\r\n"; $headers = "Content-type: multipart/alternative charset=iso-8859-1\r\n"; $headers = "From: \"ClairVision Network\" <\"admin@clairvision.net\">\r\n"; $body = "ClairVision Free Reading Request\n\n"; $body .= "Hello ".$name." Thankyou for requesting a free reading from ClairVision Network.\n\n"; $body .= "Your free reading has been done by ".$reader." who is one of our resident clairvoyants.\n\n"; $body .= "View ".$reader."'s public profile page:\n\n <a href=http://clairvision.net/index.php?page=user&action=pub_profile&id=$readerid>Click Here to View</a> \n\n"; $body .= "Here is the question you have asked:\n \n".$question."\n\n"; $body .= "Here is the answer to your question:\n \n".$answer."\n\n"; $body .= "Thankyou for visiting ClairVision Network\n\n"; $body .= "Kind regards ".$reader."\n\n"; mail($to, $subject, $body, $headers); Kind regards Chris Quote Link to comment https://forums.phpfreaks.com/topic/278657-php-simple-mail-query/ Share on other sites More sharing options...
PravinS Posted June 1, 2013 Share Posted June 1, 2013 Try using this this headers $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: \"ClairVision Network\" <\"admin@clairvision.net\">\r\n"; Quote Link to comment https://forums.phpfreaks.com/topic/278657-php-simple-mail-query/#findComment-1433509 Share on other sites More sharing options...
promotec Posted June 1, 2013 Author Share Posted June 1, 2013 No this isn't working it is what the headers where to start with which surprised me when the ahref just showed as code, this is what has me baffled. Quote Link to comment https://forums.phpfreaks.com/topic/278657-php-simple-mail-query/#findComment-1433520 Share on other sites More sharing options...
PravinS Posted June 1, 2013 Share Posted June 1, 2013 use any php mailer class, you can check this url http://www.phpclasses.org/search.html?words=php+mailer&x=-421&y=-163&go_search=1 Quote Link to comment https://forums.phpfreaks.com/topic/278657-php-simple-mail-query/#findComment-1433522 Share on other sites More sharing options...
Solution promotec Posted June 1, 2013 Author Solution Share Posted June 1, 2013 Ok I have solved it, I didn't need to use an a href, just the url itself then it comes up hyperlinked, thankyou for your assistance anyway guys much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/278657-php-simple-mail-query/#findComment-1433524 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.