title: How to echo that the email has been sent?
body: <p>Here it is  a working script in phpmailer. It sends emails from the "Maile" table BUT after the emails are sent I see only email has been sent. If there were 10 emails I get 10x - email has been sent. I would like to it to be shown like this - xxxx@xxxx.xx - email has been sent. How should I do it? Thank You. Here is the code without the part showing the connection with the mail server...</p>
  
  <pre><code> &lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  
  
  
  
  &lt;?php
  
  $con = mysql_connect("XXXX","XXXX","XXXX");
  if (!$con){
  die("NOT connected: " . mysql_error());
  }
  mysql_select_db("test",$con);
  
      $query  = "SELECT Maile FROM Mailing";
      $result = mysql_query($query,$con);
  
  while($record = mysql_fetch_array($result)){
  
  
      $mail-&gt;MsgHTML($body);
      $mail-&gt;AddAddress($record["Maile"]);
  
  
       if($mail-&gt;Send())    
          {                      
          echo 'E-mail has been sent'; 
          }            
      else    
          {           
          echo 'E-mail has not been sent';    
          }
  
  
      $mail-&gt;ClearAddresses();
      $mail-&gt;ClearAttachments();
  }
  
    ?&gt;  
  
  &lt;/html&gt;
  &lt;/head&gt;
  </code></pre>