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. Quote Link to comment 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). Quote Link to comment 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('to@example.com', 'test', 'test', 'From: you@yourdomain.com'));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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
scootstah Posted July 8, 2015 Share Posted July 8, 2015 No worries! Glad you got it working. Quote Link to comment 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.