Note that there are some explanatory texts on larger screens.

plurals
  1. POSending mail directly from a form
    primarykey
    data
    text
    <p>I have an Contact us page on my website. what i want is when someone fills the form and click on send button. The message should be arrived to my gmail. i wrote the following code for it. its not working. is there any other way i can accomplish the same.</p> <p>Html code:</p> <pre><code>&lt;form id="ContactForm" action="contacts.php" method="post"&gt; &lt;div&gt; &lt;div class="wrapper"&gt; &lt;strong&gt;Name:&lt;/strong&gt; &lt;div class="bg"&gt; &lt;input type="text" class="input" name="name"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="wrapper"&gt; &lt;strong&gt;Email:&lt;/strong&gt; &lt;div class="bg"&gt; &lt;input type="text" class="input" name="email"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="textarea_box"&gt; &lt;strong&gt;Message:&lt;/strong&gt; &lt;div class="bg"&gt; &lt;textarea cols="1" rows="1" name="message"&gt;&lt;/textarea&gt; &lt;/div&gt; &lt;/div&gt; &lt;a href="javascript:;" onclick="document.getElementById('ContactForm').submit();" class="button"&gt;&lt;span&gt;Send&lt;/span&gt;&lt;/a&gt; &lt;a href="#" class="button"&gt;&lt;span&gt;Clear&lt;/span&gt;&lt;/a&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p>php code</p> <pre><code>&lt;?php session_start(); $to = "someemail@gmail.com"; $subject = "Someone Tried to contact you"; $message = $_POST['message']; $fromemail = $_POST['email']; $fromname = $_POST['name']; $lt= '&lt;'; $gt= '&gt;'; $sp= ' '; $from= 'From:'; $headers = $from.$fromname.$sp.$lt.$fromemail.$gt; mail($to,$subject,$message,$headers); echo "mail sent"; exit(); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload