pixelchicken Posted January 16, 2010 Share Posted January 16, 2010 Hi guys, I've been struggling with this for a while and had no luck. I've created a very simple php form for my client and it's sending the results to a hotmail account no worries. My client's e-mail is with activ8 and they are not recieveing a single e-mail from the PHP form. I understand I can 'whitelist' an e-mail address in my client's e-mail account. My question is: a) if this is the solution, which address do I whitelist? As it's coming from a PHP form and not an e-mail address as such, I'm not sure how to tackle this. b) if this is not the solution, what else should I try? Thanks so much for your help guys, I really appriciate it PXLCKN Quote Link to comment https://forums.phpfreaks.com/topic/188660-simple-e-mail-form-only-working-with-some-e-mail-accounts/ Share on other sites More sharing options...
mmarif4u Posted January 16, 2010 Share Posted January 16, 2010 At the mean time you can check the Junk/Spam folder. If this does not work. Your files will be hosted with a hosting company, by sending emails through a PHP form it use the hosting company domains/ips. You can check more with your service provider. So after that you can set in the PHP code 'From', so it will send the email to the correct addresses. Just a thought. Quote Link to comment https://forums.phpfreaks.com/topic/188660-simple-e-mail-form-only-working-with-some-e-mail-accounts/#findComment-996010 Share on other sites More sharing options...
PFMaBiSmAd Posted January 16, 2010 Share Posted January 16, 2010 It would take seeing your code to be able to even begin to tell you why it is not working. Quote Link to comment https://forums.phpfreaks.com/topic/188660-simple-e-mail-form-only-working-with-some-e-mail-accounts/#findComment-996061 Share on other sites More sharing options...
pixelchicken Posted January 25, 2010 Author Share Posted January 25, 2010 Thanks guys. Well, the code I am using is below. I don't understand though, as I am recieving the email in my hotmail account just fine. It just doens't seem to be getting through to my client's email. Any further advice very gratefully accepted - I'm a bit lost! Thanks guys.. <?php if(isset($_POST['submit'])) { $to = "CLIENT_EMAIL_HERE"; $subject = "Contact / Booking Form from booking Website"; $name = $_REQUEST['name']; $email_field = $_POST['email']; $phone = $_POST['phone']; $comments = $_POST['comments']; $headers = "From: $name via booking website"; $body = "From: $name \n\n E-Mail: $email_field\n\n Phone Number: $phone\n\n Message:\n $comments\n"; header( "Location: thankyou_contact.html" ); mail($to, $subject, $body, $headers); } else { echo "Unexpected error. Please contact your website host"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/188660-simple-e-mail-form-only-working-with-some-e-mail-accounts/#findComment-1001052 Share on other sites More sharing options...
teamatomic Posted January 25, 2010 Share Posted January 25, 2010 Move the header() after the mail() and see what happens. HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/188660-simple-e-mail-form-only-working-with-some-e-mail-accounts/#findComment-1001060 Share on other sites More sharing options...
pixelchicken Posted January 25, 2010 Author Share Posted January 25, 2010 Hmmm... didn't change a thing... Quote Link to comment https://forums.phpfreaks.com/topic/188660-simple-e-mail-form-only-working-with-some-e-mail-accounts/#findComment-1001061 Share on other sites More sharing options...
greatstar00 Posted January 25, 2010 Share Posted January 25, 2010 i wonder how u can receive the email in msn, or hotmain when header() before mail() $headers = "From: $name via booking website"; this should be some email header, not those u specify like from email address (u can put watever address u want, like From: [email protected]) and email's mime type, text/text, text/html Quote Link to comment https://forums.phpfreaks.com/topic/188660-simple-e-mail-form-only-working-with-some-e-mail-accounts/#findComment-1001063 Share on other sites More sharing options...
pixelchicken Posted January 25, 2010 Author Share Posted January 25, 2010 Hi greatstar00, I think I know what you mean. Could you please give me an example of the code I should use for the header then? Or do I just not specify it? I am recieveing the emails in hotmail and my other webmail accoutn so I'm not sure if this is the problem?? Thanks... Quote Link to comment https://forums.phpfreaks.com/topic/188660-simple-e-mail-form-only-working-with-some-e-mail-accounts/#findComment-1001064 Share on other sites More sharing options...
greatstar00 Posted January 25, 2010 Share Posted January 25, 2010 u can set the header as from email $headers="From: [email protected]"; Quote Link to comment https://forums.phpfreaks.com/topic/188660-simple-e-mail-form-only-working-with-some-e-mail-accounts/#findComment-1001067 Share on other sites More sharing options...
pixelchicken Posted January 25, 2010 Author Share Posted January 25, 2010 I just took out the following code: $headers = "From: $name via booking website"; And it only bloody worked! I don't really understand why, but it's now coming through into my client's e-mail address. greatstar00, you truly are a great star. You've really saved me here, thanks mate Quote Link to comment https://forums.phpfreaks.com/topic/188660-simple-e-mail-form-only-working-with-some-e-mail-accounts/#findComment-1001072 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.