nootkan Posted February 23, 2017 Share Posted February 23, 2017 I am just learning php and found this solution online but it isn't working right for me. The email link in the body isn't sending the recipients email address, it is sending the example email address. I have changed the first example email address to my own. I know I should be replacing the second example email address with something else but not sure with what. I tried replacing useremail@example.com with just "email" and $email but neither worked. The php page works fine with the exception of not emailing me with the email address that wants to unsubscribe. I don't have a mailing list this is just for my regular emails that I send out to conform with spam rules. Can someone help me out? <a href="http://www.example.com/unsubscribe.php?email=useremail@example.com">Click to Unsubscribe</a> <?php mail("myemail@mydomain.com","unsubscribe", $_GET['email']); echo "You have unsubscribed from Domain Name"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/303278-help-with-creating-an-unsubscribe-php-page/ Share on other sites More sharing options...
ginerjm Posted February 23, 2017 Share Posted February 23, 2017 You need to write a script that presents an input form to the user where he will type in his address. The form's submit button should take you to the emailing script where it will retrieve the $_POST values from the form that you want the user to provide. If the values are correct then you build the email body and the subject and the headers (very important!) and call the mail function. Try reading the php manual for mail() if you must use that. There are better mail packages out there but you seem to be at a very early stage of development. Of course if you have already done this then it would have been nice if you posted that (in the proper forum tags) so we could further help you. PS - I have no idea what that anchor tag is for. Quote Link to comment https://forums.phpfreaks.com/topic/303278-help-with-creating-an-unsubscribe-php-page/#findComment-1543283 Share on other sites More sharing options...
nootkan Posted February 23, 2017 Author Share Posted February 23, 2017 (edited) Thanks but as I said I'm not wanting to create a list for users to sign up to. I just want to conform with the spam rules that gmail, hotmail and yahoo etc require when sending normal emails to friends and family. They have all told me that even normal emails have to have an unsubscribe link in the body for them to allow me to email to their users. Most of my family and friends use gmail or hotmail and are not receiving my emails. I have corresponded with hotmail and gmail and was told this by them. Is this not true? PS I use thunderbird as my email client. Edited February 23, 2017 by nootkan Quote Link to comment https://forums.phpfreaks.com/topic/303278-help-with-creating-an-unsubscribe-php-page/#findComment-1543302 Share on other sites More sharing options...
ginerjm Posted February 23, 2017 Share Posted February 23, 2017 I have no idea what you just posted. And you email client doesn't matter here. Quote Link to comment https://forums.phpfreaks.com/topic/303278-help-with-creating-an-unsubscribe-php-page/#findComment-1543305 Share on other sites More sharing options...
Jacques1 Posted February 23, 2017 Share Posted February 23, 2017 Perhaps you can forget about the tech stuff for a moment and just explain the situation in plain English. So you are sending e-mails to your friends and family, and now you think you need an unsubscribe feature in those e-mails? Bollocks. Either you've completely misunderstood what the providers are actually saying (a link would be helpful), or somebody is pulling your leg. Quote Link to comment https://forums.phpfreaks.com/topic/303278-help-with-creating-an-unsubscribe-php-page/#findComment-1543307 Share on other sites More sharing options...
nootkan Posted February 24, 2017 Author Share Posted February 24, 2017 Sorry I didn't mean to offend anyone. I'll look for help elsewhere. Maybe the moderator can delete my account for me please. Quote Link to comment https://forums.phpfreaks.com/topic/303278-help-with-creating-an-unsubscribe-php-page/#findComment-1543337 Share on other sites More sharing options...
ginerjm Posted February 24, 2017 Share Posted February 24, 2017 You didnt' offend anyone. You just did not explain yourself very well nor did your reply to my post make any sense at all. As Jacques says - please TELL us what you are doing and want to do and leave out the "technical" stuff. Quote Link to comment https://forums.phpfreaks.com/topic/303278-help-with-creating-an-unsubscribe-php-page/#findComment-1543346 Share on other sites More sharing options...
gizmola Posted February 24, 2017 Share Posted February 24, 2017 You either have a list or you don't. If you don't have an email list there is nothing to unsubscribe from. Quote Link to comment https://forums.phpfreaks.com/topic/303278-help-with-creating-an-unsubscribe-php-page/#findComment-1543348 Share on other sites More sharing options...
TapeGun007 Posted February 24, 2017 Share Posted February 24, 2017 What I gather from his post is... he has an email list of friends and family that are all using either yahoo, gmail, or hotmail. Those three companies require a "unsubscribe" option or his outbound emails immediately go to their spam folders instead of receiving them. I'm not sure why you can't just put at the bottom of the email an HTML link with unsubscribe (even if it does nothing) and prevent it from being flagged as spam (granted I don't know that's true). Quote Link to comment https://forums.phpfreaks.com/topic/303278-help-with-creating-an-unsubscribe-php-page/#findComment-1543353 Share on other sites More sharing options...
benanamen Posted February 24, 2017 Share Posted February 24, 2017 He doesn't have a list. Somebody lied to him Quote Link to comment https://forums.phpfreaks.com/topic/303278-help-with-creating-an-unsubscribe-php-page/#findComment-1543355 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.