in that case, $_POST['email'] is blank because you are not submitting any info via POST.
a URL (like in your hyperlink) is submitted via GET. You could change your link to
HTML Code:
<a href="http://www.example.com/unsubscribe.php?email=useremail@example.com">Click to Unsubscribe</a>
and your unsubscribe.php to
PHP Code:
<?php
mail("mary@mydomain.com","unsubscribe", $_GET['email']);
you'd probably want to add some measure of validation to that, though. at least check to make sure there is an email address to submit (so you don't get blank emails), and probably a check to see if the email is subscribed (so you can say "you're already unsubscribed" when an email is submitted that's not on your mailing list).
You should also be aware that a page like this will not meet legal guidelines (in the US) if you're sending out bulk emails. You need to keep an "opt-out" list, not simply remove people from your mailing list. read more here.
Bookmarks