0

hi friends.
i have a problem with execution of the mail() of php
its not sending messages to the specified mails.
i need help to work it out so that i can complete the topic
thanks in advance

3
Contributors
16
Replies
17
Views
6 Years
Discussion Span
Last Post by sharathg.satya
0
<html>
<body>

<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
  {
  //send email
  $email = $_REQUEST['email'] ;
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
  mail("someone@example.com", "Subject: $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>

and i had wrote my mail instead of that someone@example.com

but i didnt recieve the message.
please let me know the reason for the incorrect output

0

Maybe the mail settings in PHP are not configured correctly? Perhaps you can find something wrong in phpinfo(); (somewhere in phpinfo(13); , probably).

0

Are you on a shared host? Perhaps you can find some information on email if you call that function, and check if it's correct?

0

sir i use wamp server
and i have account in free webhosting, i tried that too
but its not delivering the message

0

sir i am not having that php.ini file to see its content
what should i do now..
please dont feel bad of asking so many times and hope i will be helped

0

If you're running your own WAMP, it should be very easy to edit php.ini. If not, contact the one that is running the server.

0

i am running my own wamp
its installed by me itself
and is it that we have to mention any local host while at the time of installing??

0

What do you mean? To edit php.ini, just click on the WAMP icon and there should be something that says "Edit php.ini".

0

i have been asked SMTP and email during the time of installation
what should i fill in them
default for smtp is localhost and the one for email is you@yourdomain
any changes is to be made?

0

Well, unless you want to install your own mail server, you could enter you gmail details or something.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.