Note that there are some explanatory texts on larger screens.

plurals
  1. POPHPmailer: Send from form
    primarykey
    data
    text
    <p>Alright, I have my form (first snippet of code), and I am trying to use PHPmailer to send it. However, it sends the message without any of the information from the actual form. I am pretty lost with how to get this to work.</p> <pre><code>&lt;form action="send_form_email.php" method="post" id="ContactForm"&gt; &lt;fieldset&gt; &lt;p class="email"&gt;magazines/newspapers&lt;/p&gt; &lt;ol&gt; &lt;li&gt; &lt;label for=name&gt;Name&lt;/label&gt; &lt;input id="name" name="name" type="text" placeholder="name" required autofocus&gt; &lt;/li&gt; &lt;li&gt; &lt;label for=email&gt;Email&lt;/label&gt; &lt;input id="email" name="email" type=email placeholder="example@domain.com" required&gt; &lt;/li&gt; &lt;li&gt; &lt;label for=telephone&gt;Phone&lt;/label&gt; &lt;input id=telephone name=telephone type=tel placeholder="Eg. 888-555-5555" required&gt; &lt;/li&gt; &lt;li&gt; &lt;label for="comments"&gt;note&lt;/label&gt; &lt;textarea name=comments type=text placeholder="enter your comments" required&gt;&lt;/textarea&gt; &lt;/li&gt; &lt;li&gt; &lt;label for="file"&gt;File&lt;/label&gt; &lt;input id="file" type="file" name="file" /&gt; &lt;/li&gt; &lt;/ol&gt; &lt;/fieldset&gt; &lt;fieldset&gt; &lt;button type=submit&gt;submit&lt;/button&gt; &lt;/fieldset&gt; &lt;/form&gt; </code></pre> <p>Mail Script:</p> <pre><code>require("mail/class.phpmailer.php"); $mail = new PHPMailer(); $mail-&gt;Host = "localhost"; $mail-&gt;From = "xxxxxx@gmail.com"; $mail-&gt;FromName = "Your Name"; $mail-&gt;AddAddress("xxxxxxx@gmail.com"); $mail-&gt;Subject = "Feedback form results"; $mail-&gt;Body = $comments; $mail-&gt;WordWrap = 50; if(!$mail-&gt;Send()) { echo 'Message was not sent.'; echo 'Mailer error: ' . $mail-&gt;ErrorInfo; } else { echo 'Thank you for your feedback.'; } $email = $_REQUEST['email'] ; $comments = $_POST['telephone'] ; $phone = $_REQUEST['comments'] ; $message = $_REQUEST['message'] ; </code></pre>
    singulars
    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.
    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