title: How to add unsubscribe link in mail when using Bcc
body: <p>I am using the following code in controller to send newsletters to subscribers</p>
  
  <pre><code>$body           =    $model-&gt;letter_content;
  
  
  $to_email       =   'admin@site.in';
  
  
  for($i=0;$i&lt;count($msg_to);$i++){
              $maitto         =   $msg_to[$i];
                 if($maitto != '')
                  $headers       .=   'Bcc:'.$maitto."\r\n";
          }
  
   mail($to_email,$subject,$body,$headers);
  </code></pre>
  
  <p>the variable <strong>'$msg_to'</strong> contains all subscriber list as array.
  The variable <strong>'$body'</strong> has the saved static newsletter body..
  I am sending the mail to admin and adding all subscribers as <strong>'Bcc'</strong> as I dont want to use mail function inside the for loop to send individually to all subscribers.
  Now I want to add a link in the mail to allow subscribers to unsubscribe..If i was sending mail individually inside the for loop i could have used something like this inside loop before <strong>mail()</strong> function</p>
  
  <pre><code>$body .= '&lt;a href="unsubscribe.php?id=$maitto"&gt;UNSUBSCRIBE&lt;/a&gt;'
  </code></pre>
  
  <p>But since here i am using 'Bcc' is there any other way to do it.</p>
  
  <p>Thank you.</p>