当客户购买时,我的应用程序会发送一封确认电子邮件。8 / 10 发送正常,但 2 / 10 返回错误消息,指出电子邮件地址丢失,无法尝试发送。
我已经检查了提供电子邮件的 SESSION,它似乎工作正常。我想知道配置或代码中是否有可以调整的东西来解决问题。
非常感谢 !
这是我现有的配置 /Code :
<?php
$config['wrapchars'] = '76';
$config['mailtype'] = 'html';
$config['wordwrap'] = TRUE;
$config['crlf'] = "\r\n";
$config['newline'] = "\r\n";
$this->email->initialize($config);
$templates = $this->MEmail->getEmailTemplate('2');
$email = $_SESSION['email'];
foreach($templates->result() as $row)
{$message = $row->Contents;
$templatename = $row->Name;
}
$pickupdate = $_POST['pickupdate'];
$pickuplocation = $_POST['location'];
$start_time=$data['times']['start_time'];
$endtime=$data['times']['endtime'];
$data = array(
'heading' => 'Country Lane Farms: Your Order Details',
'message' =>$message,
'firstname' => $_SESSION['firstname'],
'lastname' => $_SESSION['lastname'],
'order_num' => $_SESSION['order_num'],
'totalprice' => $_SESSION['totalprice'],
'orders'=> $_SESSION['cart'],
'pickupdate' => $pickupdate,
'pickuplocation'=> $pickuplocation,
'start_time' => $start_time,
'endtime' => $endtime
);
$html = $this->load->view('/templates/confirm_order.php',$data, TRUE);
$this->email->clear();
$this->email->from('orderdesk@countrylanefarms.com', 'Country Lane Farms (Jerry)');
$this->email->to($email);
$this->email->subject($templatename);
$this->email->message($html);
$this->email->send();
?>