Note that there are some explanatory texts on larger screens.

plurals
  1. POForm for sending mail not sending
    primarykey
    data
    text
    <p>I have a "tell a friend" pop up email form that allows users to share my page with an email address that they enter. It pops up fine, but I can't get the form to send the email.</p> <p>html:</p> <pre><code>&lt;div id="tellfriend"&gt; &lt;a href="#close"&gt;Close&lt;/a&gt; &lt;form id='tellafriend_form' method="post" action="#sendMessage" name="tellafriend_form"&gt; &lt;label for="name"&gt;Your Name:&lt;/label&gt; &lt;input type="text" id="name" name="name" /&gt; &lt;label for="to"&gt;Friend's email:&lt;/label&gt; &lt;input type="text" id="to" name="to" /&gt; &lt;label for="subject"&gt;Subject:&lt;/label&gt; &lt;input type="text" id="subject" name="subject" /&gt; &lt;label for="message"&gt;Message:&lt;/label&gt; &lt;textarea id="message" name="message"&gt;&lt;/textarea&gt; &lt;input type="submit" name="submit" value="Submit"&gt; &lt;/form&gt; &lt;/div&gt;&lt;!-- #tellfriend --&gt; </code></pre> <p>javascript that handles the "pop up":</p> <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script&gt; $(function() { $('#tellfriend').hide(); $('#sendMessage').click(function(e) { $("#tellfriend").fadeToggle('fast'); }); }); &lt;/script&gt; </code></pre> <p>php that's supposed to send the mail:</p> <pre><code>&lt;? if (isset($_POST['Submit'])) { // This will check to see if the form has been submitted $senders_name = $_POST['name']; // The person who is submitting the form $recipient_friend = $_POST['to']; // The forms recipient $subject = $_POST['subject']; // The subject line $message = $_POST['message']; // The message being sent mail($recipient_friend, "From $senders_name", $subject, $message); if (isset($_POST['your_email'])) { echo "&lt;br&gt;Your friend has been contacted &lt;br&gt;&lt;br&gt;Thank you $senders_name"; }} ?&gt; </code></pre> <p>Disclaimer: PHP newbie, hoping to learn. Thanks!</p>
    singulars
    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.
 

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