Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Email mesages can contain differently formated content. By default they are plaintext. To obtain the effect of line breaks, the best way is to send an HTML formated email. Even better, you could format your data as a table.</p> <p>This is the HTML mail example from <a href="http://php.net/manual/en/function.mail.php" rel="nofollow">http://php.net/manual/en/function.mail.php</a> addapted to your snippet:</p> <pre><code>&lt;?php // multiple recipients $to = 'aidan@example.com' . ', '; // note the comma $to .= 'wez@example.com'; // subject $subject = 'My data'; // message -&gt; start creatin a table and a nice header $message = ' &lt;html&gt; &lt;head&gt; &lt;title&gt;My Data&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;Nice message here&lt;/p&gt; &lt;table&gt; &lt;tr&gt; &lt;th&gt;Level&lt;/th&gt;&lt;th&gt;Institution&lt;/th&gt;&lt;th&gt;Board&lt;/th&gt;&lt;th&gt;Division&lt;/th&gt; &lt;/tr&gt;'; $ids = explode(',', $_POST['count']); foreach ($ids as $id) { $level = $_POST['level' . $id]; $institution = $_POST['institution' . $id]; $board = $_POST['board' . $id]; $division = $_POST['division' . $id]; //add each data row to the message as a table row $message .= "&lt;tr&gt;&lt;td&gt;$level&lt;/td&gt;&lt;td&gt;$institution&lt;/td&gt;&lt;td&gt;$board&lt;/td&gt;&lt;td&gt;$division&lt;/td&gt;&lt;/tr&gt;"; } //close the html table and page $message .= ' &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; '; // 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 $send_contact=mail($to,$subject,$message,$headers); // Check, if message sent to your email if($send_contact){ echo "We've recived your contact information"; } else { echo "ERROR"; } </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.
 

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