Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'll assume the form is submitted from a website, and that you're not trying to create a submittable form in an email. To copy the data submitted in the form, $_POST[""]; would surely be the best way to obtain the data. Obviously the data wouldn't be manipulatable once the email has arrived in the recipient's inbox but, as I say, I'm assuming you're not trying to create a form which can be submitted from an email.</p> <p>Your form on the website was fine:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;/head&gt; &lt;body style="padding:3px; margin:0px;" bgcolor="#FFFFFF"&gt; &lt;table cellpadding="0" cellspacing="0" border="0" width="440"&gt; &lt;tr&gt;&lt;td style="height:10px"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2" style="text-align:justify; line-height:15px;" class="body"&gt; &lt;form name="frm" method="POST" action="careersuccess.php" enctype="multipart/form-data"&gt; &lt;table cellpadding="0" cellspacing="0" border="0" width="100%"&gt; &lt;tr&gt; &lt;td width="23%" class="body"&gt; Name&lt;/td&gt; &lt;td width="3%" class="body"&gt;:&lt;/td&gt; &lt;td width="74%"&gt;&lt;input type="text" name="strname" class="textfield"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td style="height:3px"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td width="23%" class="body"&gt; Address&lt;/td&gt; &lt;td width="3%" class="body"&gt;:&lt;/td&gt; &lt;td width="74%"&gt;&lt;textarea cols="16" name="straddress"&gt;&lt;/textarea&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td style="height:3px"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td width="23%" class="body"&gt; City&lt;/td&gt; &lt;td width="3%" class="body"&gt;:&lt;/td&gt; &lt;td width="74%"&gt;&lt;input type="text" name="strcity" class="textfield"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td style="height:3px"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td width="23%" class="body"&gt; State&lt;/td&gt; &lt;td width="3%" class="body"&gt;:&lt;/td&gt; &lt;td width="74%"&gt;&lt;input type="text" name="strstate" class="textfield"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td style="height:3px"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td width="23%" class="body"&gt; Contact No&lt;/td&gt; &lt;td width="3%" class="body"&gt;:&lt;/td&gt; &lt;td width="74%"&gt;&lt;input type="text" name="strno" class="textfield"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td style="height:3px"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td width="23%" class="body"&gt; Email&lt;/td&gt; &lt;td width="3%" class="body"&gt;:&lt;/td&gt; &lt;td width="74%"&gt;&lt;input type="text" name="stremail" class="textfield"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td style="height:3px"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td width="23%" class="body"&gt; Comments&lt;/td&gt; &lt;td width="3%" class="body"&gt;:&lt;/td&gt; &lt;td width="74%"&gt;&lt;textarea cols="16" name="strcomments"&gt;&lt;/textarea&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td style="height:3px"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td width="23%" class="body"&gt; Resume&lt;/td&gt; &lt;td width="3%" class="body"&gt;:&lt;/td&gt; &lt;td width="74%"&gt;&lt;input type="file" name="strresume"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td style="height:10px"&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2" align="center"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Your file careersuccess.php would then need to include something like:</p> <pre><code>&lt;?php // multiple recipients $to = 'demo@localhost.com' . ', '; // note the comma $to .= 'demo@localhost.com'; // subject $subject = 'Birthday Reminders for August'; $strName = $_POST["strname"]; //assigns strname from form to PHP variable $strAddress = $_POST["straddress"]; $strCity = $_POST["strcity"]; $strState = $_POST["strstate"]; $strNumber = $_POST["strnumber"]; $strEmail = $_POST["stremail"]; $strComments = $_POST["strcomments"]; $strResume = $_POST["strresume"]; $lineBreak = "&lt;br /&gt;\n\"; //adds carriage return to break up your message $message = "Name: ".$strName.$lineBreak."Address: ".$strAddress.$lineBreak."City: ".$strCity.$lineBreak."State: ".$strState.$lineBreak...for the rest of your variables; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: Mary &lt;mary@example.com&gt;, Kelly &lt;kelly@example.com&gt;' . "\r\n"; $headers .= 'From: Birthday Reminder &lt;birthday@example.com&gt;' . "\r\n"; $headers .= 'Cc: birthdayarchive@example.com' . "\r\n"; $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); ?&gt; </code></pre> <p>That will result in the submitted values of the form being copied in to the email in the $message variable for the mail() function.</p>
    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.
 

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