barça Posted June 11, 2006 Share Posted June 11, 2006 Hi Ive just made my first webpage for a friend's restaurant and I have got a contact form which sends emails to two addresses (depending which subject is chosen).Everything seems OK and Im new to php so the code itself is still a little baffling, its made of a mixture of script i found on the web and some help from forums.One problem, when I test the contact sheet, only about fifty percent of the time do they actually arrive to my inbox. Why could this be? Is it a problem in the html page with the form:[a href=\"http://www.bernisnudelbrett.de/en/contact_us.html\" target=\"_blank\"]http://www.bernisnudelbrett.de/en/contact_us.html[/a]or in the coding on the php page?The code is as follows:[code]<?php$emailfield = $_POST['emailfield'];$concern = $_POST['concerning'];if ($concern == 'information') { $mailto = 'info@bernisnudelbrett.de';}else { $mailto = 'web@bernisnudelbrett.de';}$mailsubj = "A message from a website visitor";$mailhead = "From: ".$emailfield;$mailbody = "A message from a website visitor:\n";while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }?>[/code]Any help would be much appreciated, Ive just got PHP for dummies, but as someone who hasnt used computer language like this before, it's still a bit baffling to me.ThanksBarça Quote Link to comment https://forums.phpfreaks.com/topic/11726-contact-forms-not-always-arriving/ Share on other sites More sharing options...
wildteen88 Posted June 11, 2006 Share Posted June 11, 2006 When sending emails with PHP sometimes email clients treat these as spam emails and so they dont arrive in your inbox instead they'll be located in your junk/spam folder.Also I see you are not validating user input, you should validate user input as a malicous hacker/spammer could pertentially spam your client. Quote Link to comment https://forums.phpfreaks.com/topic/11726-contact-forms-not-always-arriving/#findComment-44348 Share on other sites More sharing options...
barça Posted June 11, 2006 Author Share Posted June 11, 2006 [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Also I see you are not validating user input, you should validate user input as a malicous hacker/spammer could pertentially spam your client.[/quote]Is that just a question of adding a line? Could you point me in the right direction for that?At the moment, the emails are redirected from the emails of the same domain to other emails (controlled from a panel provided by the hosting service) I know I can set it up so there's a catchall account, but is that necessary? My email client that recieves them at the end shows everything in my inbox so I know the problem is not there as it has no spam filters. Quote Link to comment https://forums.phpfreaks.com/topic/11726-contact-forms-not-always-arriving/#findComment-44356 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.