Hello, I am using a PHP script that was given to me by someone on here a while back but it does not seem to be working now. Could someone take a look at it please and see if you can see why? HTML Code <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <?php if ($errors) echo '<p>The following errors occurred: <br />' . join('<br />', $errors) . '</p>'; ?> <p>Name:<br> <input name="name" type="text" /> </p> <p>Email:<br> <input name="email" type="text" /> </p> <p>Subject:<br> <input name="subject" type="text" /> </p> <p>Message:<br> <textarea name="message" rows="10" cols="80"></textarea> <br /> <input type="submit" value="Send" /><input type="hidden" name="do" value="send" /><input type="reset" value="Reset" /> </p></form> Code (markup): PHP Code <?php $errors = array(); if($_POST['do']=="send") { $recipient="email@email.com"; // Set your email here // if (!$subject=$_POST['subject']) $errors[] = 'Subject required'; if (!$name=$_POST['name']) $errors[] = 'Name required'; if (!$email=$_POST['email']) $errors[] = 'Email required'; if (!$message=$_POST['message']) $errors[] = 'Message required'; if (!$errors) { $message = "Name: {$name}\n\nMessage:\n{$message}"; $formsend=mail("$recipient", "$subject", "$message", "From: $name ($email)\r\nReply-to:$email"); echo("<p>Your message was successfully sent!</p>"); }} ?> Code (markup): Thanks in advance to anyone who can help me on this one.
Well I am not getting any errors but when I change the email to various email addresses I don't seem to receive them so am not sure why, I get some emails when I use it but they are usually delayed and most I simply don't get. Any ideas on that? Is it something to do with my host maybe?
Try this: http://www.free-php-scripts.net/P/Contact_Form If it doesn't work, then the problem is with the host. Peace,
also, make sure you are checking your junk email folders, alot of times these types of emails will go to the spam folder
Most likely, your server's sendmail or postfix is misconfigured. I had one server that would always get caught by spam filters not for open relays, but because of the address sendmail was sending with. Wierd stuff. Also, make sure your server is not blacklisted.