email send request to user [closed]
i want 开发者_JAVA技巧to create a button and one text box. now i want user can send any site of link to his friend how can i give this all. can i get any structure of code or can i get code that where i can create this.
<form action="mail.php" method="post"> <label for="email">your friend email</label> <input name="email" type="edit"/> <input type="submit" value="send link to friend"/> </form> <? if (isset($_POST('email')) { if (!mail($_POST('email'), "Site link", "check this link " . $_SERVER['HTTP_REFERER'])) { echo "I couldn't send email, sorry."; } } ?>
If you use something like PHP mailer on your site then you can integrate that into the mailing and make things really easy for yourself. Just add in the settings, build the e-mail and pass it through the functions that are needed.
精彩评论