0

当客户购买时,我的应用程序会发送一封确认电子邮件。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();

?>  
4

1 回答 1

1

唯一的原因是会话正在被破坏。我建议创建一个 TEXtFile 或数据库日志 [无论如何你希望日志是] 并在日志中记录会话变量,以及是否发送电子邮件消息。这将告诉您可能发生的情况,也许您也想在日志中打印其他变量。

于 2013-06-05T10:41:16.647 回答