title: PHPMailer send email with array
body: <p>Hi I have question about HTML form array and PHP. For example I have name and email but ask 6 times and I want to send this mail. What I should edit to work? thank you!</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>   &lt;form  method="Post" action="send.php" onSubmit="return validate();"&gt;
      &lt;?php
       $amount=6; //amount shows the number of data I want to repeat
       for( $i = 0; $i &lt; $amount; $i++ ) {
          ?&gt;
          &lt;b&gt;Data &lt;?php echo $i+1 ?&gt;º&lt;/b&gt;
            &lt;input type="edit" name="Name[]" size="40"&gt;
            &lt;input type="edit" name="email[]" size="40"&gt;
            &lt;br&gt;
      &lt;?php } ?&gt;
            &lt;input type="submit" name="Submit" value="send 6 data mail"&gt;
     &lt;/form&gt;
  </code></pre>
  
  <p><strong>send.php:</strong></p>
  
  <pre><code>&lt;?php
         require('phpmailer/class.phpmailer.php');
         $name= $_POST['name[]']; 
         $email= $_POST['email[]']; 
         $mail = new PHPMailer();
         ...
         $mail-&gt;Body = ' Data&lt;br&gt; '
      &lt;?php
       $amount=6; //amount shows the number of data I want to repeat
       for( $i = 0; $i &lt; $amount; $i++ ) {
          ?&gt; '
         name: '.$name[$i].' email: '.$email[$i];
         ...
         $mail-&gt;Send();
  ?&gt;
  </code></pre>
  
  <p>should send:</p>
  
  <pre><code>Data
  name: nameinput1 email: emailinput1
  name: nameinput2 email: emailinput2
  name: nameinput3 email: emailinput3
  name: nameinput4 email: emailinput4
  name: nameinput5 email: emailinput5
  name: nameinput6 email: emailinput6
  </code></pre>