TommyLox Posted February 15, 2012 Report Share Posted February 15, 2012 Hi - I'm can't seem to be able to receive emails when I complete and submit my forms. I followed the tutorials to the letter, so I guess the issue is doen to my MAMP configuration? My form_response.php code block is: <?php $name_first = $_POST['name_first']; $email = $_POST['email']; $football_team = $_POST['football_team']; $best_player = $_POST['best_player']; $comments = $_POST['comments']; print "First name: {$name_first} with an email of: {$email}. Your favourite football team is: {$football_team} and you feel the best player is {$best_player}. We also take note of your comments: {$comments}"; $email_message = "First Name: {$name_first} with an email of: {$email}"; mail('tomanderson83@gmail.com','Form Response ', $email_message); ?> I am unsure how to fix this and receive the email, please help! Thanks a million!! Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 16, 2012 Report Share Posted February 16, 2012 As a general rule, I tell people not to test the mail() function on their local computer, but rather to test that functionality on your web hosting. I believe it is possible to get mail() to work properly, but my understanding is that it is a bit fiddly and requires editing your php.ini file with your SMTP details. Quote Link to comment Share on other sites More sharing options...
Wickham Posted February 16, 2012 Report Share Posted February 16, 2012 If you want to send from MAMP, have a look at this tutorial:- http://roshanbh.com.np/2007/12/sending-e-mail-from-localhost-in-php-in-windows-environment.html Find php.ini in the MAMP folders and edit carefully (save a copy of the original). Note that it says "Note : Some smtp server verifies the email address of the sender so the email address which is in the place of “sender@sender.com” should be a valid and existing email address otherwise mail might not be sent to the “you@yourdomain.com”." For your first tests, send From your own domain To your own domain because if the "From" part of the email has a strange domain it may be viewed as spam because emails sent from a different domain name from your own looks like a problem and eventually you will be blocked. It happened to me and I had to phone to get unblocked. Quote Link to comment Share on other sites More sharing options...
TommyLox Posted February 16, 2012 Author Report Share Posted February 16, 2012 Thanks Ben and Wickham. I agree that it's fiddly (!), so I will resist testing the mail function through MAMP for now and test that functionality on my web host. 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.
Note: Your post will require moderator approval before it will be visible.