Hi Once again!
I don`t Know. In a page I have a contact form in that The fields are ike name, email, subject, message.
All are mandatory.
I wont store in database. After clicking submit query , it should go to admin mail how to do?
tell me with example?

Recommended Answers

What have you tried? Have you searched the php manual for sending email?

Jump to Post

All 3 Replies

Member Avatar

What have you tried? Have you searched the php manual for sending email?

let me try

Try this:

<?php
$from = $_POST["name"];
$mailer = $_POST["email"];
mail("someemail@something.com", "Contents", "Subject", $from);
?>

and this HTML to follow(Note: this is from a website I made, so keep in mind that is is quite raw):

<html>
<head>
  <title>Abby Phillips</title>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  <script>
    $(document).ready(function() {
      $("#ld1").css('background-color', 'blue');
      $("#ld2").css('background-color', 'blue');
      $("#ld3").css('background-color', 'blue');

      $("#ld1").hover(function() {
        $("#ld1").css('background-color', 'white');
      }, function(){
          $("#ld1").css('background-color', 'blue');
      });

      $("#ld2").hover(function() {
        $("#ld2").css('background-color', 'white');
      }, function(){
          $("#ld2").css('background-color', 'blue');
      });

      $("#ld3").hover(function() {
        $("#ld3").css('background-color', 'white');
      }, function(){
          $("#ld3").css('background-color', 'blue');
      });

    });
  </script>
</head>
<body background="bg.png" style="background-size:cover;">
<p>&nbsp;</p>
<center>
<table>
<tbody>
<tr>
<td id="mainTable">
<div id="ld1" class="linkDiv"><a id="mainMenu" href="index.html">Home</a></div>
</td>
<td id="mainTable">
<div id="ld2" class="linkDiv"><a id="mainMenu" href="cont.html">Info</a></div>
</td>
<td id="mainTable">
<div id="ld3" class="linkDiv2"><a id="mainMenu" href="sched.html"><span style="font-size: 300%;">Schedule</span></a></div>
</td>
</tr>
</tbody>
</table>
<div id="mainDiv"><center>
<div style="background: blue; width: 400; height: 500; border-radius: 20px; border: 5px solid white;">
<p style="padding-top: 20;">&nbsp;</p>
<div style="background-color: grey; width: 300; border-radius: 20px;"><form action="mailed.php" method="post"><label>Name: <em><img src="req.png" alt="" width="10" height="10" /></em></label><input name="name" required="" type="text" placeholder="John Doe" />
<p>&nbsp;</p>
<label><label>Email: <em><img src="req.png" alt="" width="10" height="10" /><input name="email" required="" type="text" placeholder="example@mail.com" /></em></label></label>
<p>&nbsp;</p>
<label><label><em>Comment: <textarea style="height: 80;" name="comment" placeholder="No comment"></textarea></em></label></label>
<p>&nbsp;</p>
<label><em><input type="submit" /> </em></label></form></div>
</div>
</center></div>
</center>
</body>
</html>
Be a part of the DaniWeb community

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