Get current URL & HTML mail<

liunx

Guest
OK, I've got two questions:

1) I want to make a simple "send page URL to a friend" feature to a website. Easy enough to use mail();, but what PHP code can I use to grab the current URL of the page? E.g. if I were on this page and there was a "send URL to friend" feature, it must grab the URL of THIS page and mail it.

2) How easy is it to use mail(); to send a HTML message instead of a plain text e-mail? Using HTML code in a normal mail(); message field does not work. Where do I set the MIME type to text/html?

Thanks!1) $URI = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
If I'm not mistaken...

2) I'm not sure about this, but try adding Content-Type to your headers, the fourth parameter of mail().
$header .= "Content-type: text/html; charset=iso-8859-1\r\n";
or any charset of your choice.Thanks, Rydberg, I'll check it out as soon as I can. Thanks! :)<!-- m --><a class="postlink" href="http://www.snippetlibrary.com/viewhtml.php?id=6&kid=13&siteid=99">http://www.snippetlibrary.com/viewhtml. ... &siteid=99</a><!-- m -->
 
Back
Top