我需要在用户订阅完成时发送的电子邮件正文中添加一个链接。然后,此链接应向一个地址发送一封电子邮件,该地址表明“用户名”要续订其订阅。所以我需要在 php mail() 中做一个 php mail(),如果你理解我的话!此外,在他们单击链接后,他们应该会收到一条感谢消息。当前 'sendExpiryEmail' 函数的 php 代码如下。希望你能帮忙!谢谢。
公共函数 sendExpiryEmail($emails){
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 = '<p><img src="http://az-china.com/images/azchina_logo_email.jpg"></p>
<p>Dear '.$name.',<br /><br />
We hope you have been enjoying your subscription to the Black China Report.<br /><br />
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.<br />
We have some exciting new initiatives planned in the coming months.<br /><br />
Your Black China Report subscription will expire on '.$expirydate.'.<br /><br />
<strong>Renewing your subscription is easy.</strong><br /><br />
Simply click here (link to mail()) and we will send you an order form and details on how to pay.<br /><br />
If we can be any further assistance, please do not hesitate to contact us! <br /><br />
Yours sincerely, <br /><br />
Tom Martin<br /><br />
AZ China</p>';
// 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 <tom.martin@az-china.com>' . "\r\n";
// Mail it
mail($to, $subject, $body, $headers);
}
}