issue with PHP and sending emails


Well-Known Member
Apr 28, 2006
hello all,

I'm not sure if this is the place to post this question to or not. I'm having an issue with a PHP script that I'm running off my domain that is located on my box. I can send and receive email just fine within my email client. I've got a PHP contact script that will not run though and Im not sure what the issue is.

I've checked the error logs in apache the only thing I get is this.
[Fri Jun 9 15:17:58 2006] [error] [client] client denied by server configuration: /home/users/ezwebsol/public_ht$
here is the PHP email form I'm trying to run. just a quick one I slapped together. it works on another box I have. which is why it's so confusing.

if ($_POST['submit'] == TRUE) {
	$receiverMail = "[email protected]";
	$name		= stripslashes(strip_tags($_POST['name']));
	$email		= stripslashes(strip_tags($_POST['email']));
	$subject	= stripslashes(strip_tags($_POST['subject']));
	$msg		= stripslashes(strip_tags($_POST['msg']));
	$ip			= $_SERVER['REMOTE_ADDR'];
	$msgformat	= "From: $name ($ip)\nEmail: $email\n\n$msg";

	if(empty($name) || empty($email) || empty($subject) || empty($msg)) {
		echo "<h2>The email was not sent</h2><p>Please fill all the required fields</p>";
	elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
		echo "<h2>The email was not sent</h2><p>The email address is invalid</p>";
	elseif(mail($receiverMail, $subject, $msgformat, "From: $name <$email>")) {
		echo "<h2>The email has been sent!</h2><p>I will get back to you as soon as possible.</p>"; }
	else {
		echo "<h2>The email was not sent</h2><p>Please try again... If the problem continues there's probably something wrong with the server.</p>";
else { ?>
<form method="post" action="">
	<label for="name">Name</label>
	<input id="name" name="name" type="text" size="30" maxlength="40" /><br />

	<label for="email">Email</label>
	<input id="email" name="email" type="text" size="30" maxlength="40" /><br />

	<label for="subject">Subject</label>
	<input id="subject" name="subject" type="text" size="30" maxlength="40" /><br />

	<label for="message">Message</label>
	<textarea id="message" name="msg" cols="50" rows="6"></textarea><br />

	<label for="submit">&nbsp;</label>
	<input id="submit" class="button" type="submit" name="submit" value="Send" />
<?php } ?>
This is what my PHP.ini file shows the smtp/sendmail info as.
[mail function]
; For Win32 only.
;SMTP = localhost ;
smtp_port = localhost

; For Win32 only.
;sendmail_from = [email protected] ;

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i
I do have my SMTP port running off of port 30, which I did change the port to, but didn't work either.

So, any help would be much appreciated. Thanks.
Thread starter Similar threads Forum Replies Date
D Email 2
C Email 3
F Email 4
O Email 1
M Email 3