title: Symfony swift_mail: send to multiple address but only display one address per email
body: <p>I want to send an email to a list of address but I want each person to receive the email with his email address in to: (and not with the other email addresses of the diffusion list).<br>
  I am using symfony and Swift mail. My code look like that at the moment (it is working):</p>
  
  <pre><code>public function sendmail(Notification $notification, $alert){
              $to = array();
  
              foreach ($members as $member) {
                  $to[] = $member-&gt;getUser()-&gt;getEmail();  
              }
  
              $html = $this-&gt;templating-&gt;render(
                  'PlatformBundle:Emails:email.html.twig',
                  array('alert' =&gt; $alert, 'notification' =&gt; $notification, 'user' =&gt; $this-&gt;user)
              );          
  
              // Configure and send the mail
              $message = \Swift_Message::newInstance()
              -&gt;setSubject('an email ')
              -&gt;setFrom($this-&gt;sender_email)
              -&gt;setCc($this-&gt;user-&gt;getEmail())
              -&gt;setTo($to)
              -&gt;setBody($html, 'text/html');
  
              $mailStatus = $this-&gt;mailer-&gt;send($message);
  }
  </code></pre>
  
  <p>I have 2 solutions (I do not like any for them!).    </p>
  
  <ol>
  <li><p>using BCC (<a href="https://stackoverflow.com/questions/3219965/sending-to-multiple-email-addresses-but-displaying-only-one-c-sharp">Sending to multiple Email addresses but displaying only one C#</a>) but it makes my email looking like a spam    </p></li>
  <li><p>looping and sending the same email to each member (seems really server resource consuming) </p>
  
  <pre><code>public function sendmail(Notification $notification, $alert){
          $to = array();
  
          foreach ($members as $member) {
              $to[] = $member-&gt;getUser()-&gt;getEmail();  
  
              $html = $this-&gt;templating-&gt;render(
                  'PlatformBundle:Emails:email.html.twig',
                  array('alert' =&gt; $alert, 'notification' =&gt; $notification, 'user' =&gt; $this-&gt;user)
              );          
  
              // Configure and send the mail
              $message = \Swift_Message::newInstance()
              -&gt;setSubject('an email ')
              -&gt;setFrom($this-&gt;sender_email)
              -&gt;setCc($this-&gt;user-&gt;getEmail())
              -&gt;setTo($to)
              -&gt;setBody($html, 'text/html');
  
              $mailStatus = $this-&gt;mailer-&gt;send($message);
          }
  </code></pre></li>
  </ol>
  
  <p>Is this loop OK?</p>
  
  <p>Any better idea? </p>