scootstah Posted July 8, 2015 Share Posted July 8, 2015 $emailaddress is being used from the data gathered from the HTML form isn't it..? Yes, you're right. I missed that, sorry. Try changing the From header to a static email that comes from your server's domain. The problem might be that your mail is being rejected due to spam settings. I'm not really sure. I'm trying to modify my old script that worked, but the trouble is I'm struggling to get my head round it all! Try this and see what $success is equal to: $success = mail($webMaster, $emailSubject, $body, $headers); var_dump($success);At this point I don't think recaptcha is to blame, I think that is working properly now. Link to comment https://forums.phpfreaks.com/topic/297204-upgrading-to-google-recaptcha-v2/page/2/#findComment-1515902 Share on other sites More sharing options...
ben_1uk Posted July 8, 2015 Author Share Posted July 8, 2015 Having added var_dump($success); I received bool(true). Link to comment https://forums.phpfreaks.com/topic/297204-upgrading-to-google-recaptcha-v2/page/2/#findComment-1515905 Share on other sites More sharing options...
scootstah Posted July 8, 2015 Share Posted July 8, 2015 Okay, so according to PHP the mail has been sent successfully. Let's go simple and try this out: var_dump(mail('[email protected]', 'test', 'test', 'From: [email protected]'));Are you trying this code out on a local development setup, or a live web server? Who is your hosting with? What kind of hosting is it? Link to comment https://forums.phpfreaks.com/topic/297204-upgrading-to-google-recaptcha-v2/page/2/#findComment-1515907 Share on other sites More sharing options...
ben_1uk Posted July 8, 2015 Author Share Posted July 8, 2015 Hi scootstah, I've had another tinker about with the code and I've managed to get the mails to come through! It all appears to work now :-) Thank you very much for all your help. Link to comment https://forums.phpfreaks.com/topic/297204-upgrading-to-google-recaptcha-v2/page/2/#findComment-1515911 Share on other sites More sharing options...
scootstah Posted July 8, 2015 Share Posted July 8, 2015 No worries! Glad you got it working. Link to comment https://forums.phpfreaks.com/topic/297204-upgrading-to-google-recaptcha-v2/page/2/#findComment-1515912 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.