增强PHP脚本性能

(subject of this ques might not match with the ques, but i couldn't think of better) I have a webpage, where user provides email address of recipients, there can be 100 and more email addresses delimited by ; provided.in the textarea. Ofcourse i have to send an email to all those addresses. I have 2 approches in mind but couldn't decide on which one would provide better user experience and performance.
approach 1: i loop through all those emails in my js and send ajax request to php script. But then there would be 100 requests to the server, and if user closes browser in between, all email address wont go through

approach 2: i send all the 100 email addresses in one go to the php script, and let php script loop through emails. I am assuming that i would be able to echo some mesg back to client with success message after each loop count, and even if client is dead, then also at least php will keep executing untill loop ends

can somebody pls provide me cons and pros of these 2 approaches

Here is an idea on how to implement a queue.

define('MAX_EMAIL_BUFFER_SIZE', 15);

// do a query to see how many emails are needed to be sent, you need to do store
// this data in mysql or some other place.
// array getEmails() { }

$total = count( getEmails());
$pages = ceil($total / MAX_EMAIL_BUFFER_SIZE);
$i = 0;
for(; $i < $total; $i++) {
  $offset = ($page - 1)  * MAX_EMAIL_BUFFER_SIZE;
    /* query
    SELECT
        *
    FROM
        table
    ORDER BY
        name
    LIMIT
        MAX_EMAIL_BUFFER_SIZE
    OFFSET
        $offset
   */
  // the result returned by the query are the emails you wills send.
  // do the above query in a function that returns the results

  foreach($data as $email) {
    mail(...);
  }
  // sleep for 10 seconds.
  sleep(10);
}