Hey guys im hoping someone can please help me. I'm trying to get my website to have a simple feed back from and it just won't work for me. This is the script i'm using

<?php
if (isset($_REQUEST['email']))

  {
  $email = $_POST['email'] ;
  $subject = $_POST['subject'] ;
  $message = $_POST['comment'] ;
  mail( "name@site.ie", "Subject: $subject",
  $message, "From: $email" );
  echo "Thank you for using our mail form";
  }
else

  {
  echo "<div class='container_for'>
	<form method='post' action='contact.php'>
	<div class='form_title'>Contact Form</div>
	<div class='form_subject'>Subject : <input name='subject' type='text' id='subject' size='50'></div>
	<div class='form_comment'>Comment : </div><div class='form_comment_box'><textarea name='comment' cols='50' rows='4' id='comment'></textarea></div>
	<div class='form_name'>Name : <input name='name' type='text' id='name' size='50'></div>
	<div class='form_name'>E-Mail : <input name='email' type='text' id='email' size='50'></div>
	<input type='submit' name='Submit' value='Submit'> <input type='reset' name='Submit2' value='Reset'>
	</form>
</div>";
  }
?>

I can get it to display that i have sent the message but I'm not able to recieve the emails at my sites email or my gmail.

Am I supposed to have settings done anywhere else such as smtp settings or anything?

Any help would be great thanks!

Recommended Answers

All 9 Replies

is an SMTP server set up? php's mail doesnt do anything if it's not.

That would be my problem then. I haven't a clue how to configure them. Can you give me a clue as to how to go about configuring it?

windows or linux?

windows or linux?

linux

are you hosted to webhosting companies?

or you have your own web server?

Morning guys,

I spent all day yesterday trying to figure this out. I asked my host for help and got pretty much none but a link to the mail() function on the php manual.

Eventually I contacted them again showing them my code and telling them it should work and this morning I woke up to a reply saying

"Thank you for reporting this issue.

After some investigation, we believe this is now resolved and would like to apologise for any inconvenience this may have caused you."

So now it's all working again.

Thanks for the help guys!

you should learn how to ping your smtp and pop3 server :-)

Hey guys im hoping someone can please help me. I'm trying to get my website to have a simple feed back from and it just won't work for me. This is the script i'm using

<?php
if (isset($_REQUEST['email']))

  {
  $email = $_POST['email'] ;
  $subject = $_POST['subject'] ;
  $message = $_POST['comment'] ;
  mail( "name@site.ie", "Subject: $subject",
  $message, "From: $email" );
  echo "Thank you for using our mail form";
  }
else

  {
  echo "<div class='container_for'>
	<form method='post' action='contact.php'>
	<div class='form_title'>Contact Form</div>
	<div class='form_subject'>Subject : <input name='subject' type='text' id='subject' size='50'></div>
	<div class='form_comment'>Comment : </div><div class='form_comment_box'><textarea name='comment' cols='50' rows='4' id='comment'></textarea></div>
	<div class='form_name'>Name : <input name='name' type='text' id='name' size='50'></div>
	<div class='form_name'>E-Mail : <input name='email' type='text' id='email' size='50'></div>
	<input type='submit' name='Submit' value='Submit'> <input type='reset' name='Submit2' value='Reset'>
	</form>
</div>";
  }
?>

I can get it to display that i have sent the message but I'm not able to recieve the emails at my sites email or my gmail.

Am I supposed to have settings done anywhere else such as smtp settings or anything?

Any help would be great thanks!

Probably you need SMTP-verification and then PHPMailer is a good class to use that you have to impement. Here is a link that describes the process: http://bakery.cakephp.org/articles/view/sending-email-with-phpmailer

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.