I am trying to create feedback form and want to send the content to an email id using the mail(). What should I suppose to do for that?

I tried with some code but it's not working..

Here is the code

<html>
<body>

<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  {
  ini_set('SMTP', "mail.reliconindia.x10.mx");
  ini_set('smtp_port', 5665);
  //ini_set('', "subhra44@reliconindia.x10.mx")
  //send email
  $email = $_REQUEST['email'] ;
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
  mail("subhra44@gmail.com", $subject, $message, "From:" . $email);
  echo "Thank you for using our mail form";
  }
else
//if "email" is not filled out, display the form
  {
  echo "<form method='post' action='mailform.php'>
  Email: <input name='email' type='text' /><br />
  Subject: <input name='subject' type='text' /><br />
  Message:<br />
  <textarea name='message' rows='15' cols='40'>
  </textarea><br />
  <input type='submit' />
  </form>";
  }
?>

</body>
</html>

For testing I had created a domain using x10hosting.com
It's not showing any error but mail is not sent to the email id to which I want to send..
Please suggest some solution. Thank you in advance..

The server administrator might have disabled the use of this function..
Maybe the message is being stored in the Junk Mail folder (Spam, BLOCKED, Bulk, etc.).

If you are using a free webhosting service the mail() function may be disabled because of obvious reasons (spamming).

Thank you all for the suggestions...but now it's working...

Thank you all for the suggestions...but now it's working...

You're welcome, but why didn't you mark it as solved? It's better for other members in order to avoid wasting their time.

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.