How to add a php mail() link to the body of an automated 'subscription expired' email?
<p>I need to add a link into the body of the email message which is sent when the user's subscription is finished. This link should then send an email to an address which states that 'users name' wants to renew their subscription. So i need to do a php mail() inside of a php mail(), if you understand me! Also, after they click the link, they should get a thankyou message. The php code for the current 'sendExpiryEmail' function is below. Hope you can help! Thanks.</p>

<p>public function sendExpiryEmail($emails){</p>

<pre><code>    foreach($emails as $email){

        $name = $email['name'];

        $emailaddress = $email['email'];

        $expirydate = date('jS F Y',strtotime($email['datetime_expire']));



        $subject = "AZ China Report expiry reminder";



        $body = '&lt;p&gt;&lt;img src="http://az-china.com/images/azchina_logo_email.jpg"&gt;&lt;/p&gt;

                &lt;p&gt;Dear '.$name.',&lt;br /&gt;&lt;br /&gt;

                We hope you have been enjoying your subscription to the Black China Report.&lt;br /&gt;&lt;br /&gt;

                We aim to meet the needs of our readers, by de-mystifying the China market, and by providing accurate, current and pertinent facts and analysis.&lt;br /&gt;

                We have some exciting new initiatives planned in the coming months.&lt;br /&gt;&lt;br /&gt;

                Your Black China Report subscription will expire on '.$expirydate.'.&lt;br /&gt;&lt;br /&gt;

                &lt;strong&gt;Renewing your subscription is easy.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;

                Simply click here (link to mail()) and we will send you an order form and details on how to pay.&lt;br /&gt;&lt;br /&gt;

                If we can be any further assistance, please do not hesitate to contact us! &lt;br /&gt;&lt;br /&gt;

                Yours sincerely, &lt;br /&gt;&lt;br /&gt;

                Tom Martin&lt;br /&gt;&lt;br /&gt;

                AZ China&lt;/p&gt;';



        // multiple recipients

        $to  = $emailaddress;

        //$to = 'c23gooey@gmail.com';



        // To send HTML mail, the Content-type header must be set

        $headers  = 'MIME-Version: 1.0' . "\r\n";

        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";



        // Additional headers

        $headers .= 'From: AZ China &lt;tom.martin@az-china.com&gt;' . "\r\n";



        // Mail it

        mail($to, $subject, $body, $headers);

    }

}
</code></pre>
