Jump to content


Photo

Contact forms not always arriving


  • Please log in to reply
2 replies to this topic

#1 barça

barça
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 11 June 2006 - 05:33 PM

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:

<?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); }
?>

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.

Thanks
Barça

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 11 June 2006 - 06:15 PM

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.

#3 barça

barça
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 11 June 2006 - 06:28 PM

[!--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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users