【问题标题】:Codeigniter Sendmail() mail received after 5 minutes5 分钟后收到的 Codeigniter Sendmail() 邮件
【发布时间】:2016-08-10 02:03:17
【问题描述】:

我使用 sendmail 方法向注册用户发送邮件。用户注册时发送电子邮件,但每次发送邮件需要 5 分钟。这是我的代码。

它在 codeigniter 框架中。

public function MailTest()
{
    $this->load->helper(array('form', 'url'));
    $this->load->library('form_validation');
    $this->load->library('email');

    $config['protocol'] = 'sendmail';
    $config['mailpath'] = '/usr/sbin/sendmail';
    $config['charset'] = 'utf-8';
    $config['mailtype'] = 'html';
    $config['wordwrap'] = TRUE;
    $this->email->initialize($config);
    $this->email->from('preetham@gmail.com', 'preetham');
    $this->email->to('preetham@gmail.com');

    $this->email->subject(' Success! Your order has been sent.');


    $this->email->message('Success! Your order has been sent');
$this->email->send();
 //echo $this->email->print_debugger(); 
//echo "Success";
}

我问了一些朋友,他们建议我不是编程问题,而是服务器问题。我刚刚联系了 godaddy,但我没有得到满意的结果。如果您知道解决方案,请帮助我。

【问题讨论】:

  • 托管服务器上没有。
  • 检查您的邮件队列。 Document.
  • 检查错误日志和邮件服务是否正常

标签: php codeigniter email sendmail


【解决方案1】:

尝试使用普通的 php mail() 函数来检查其服务器是否有问题

<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>

如果邮件发送速度很快,那么服务器工作正常。 检查 codeigniter 框架。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-23
    • 1970-01-01
    • 2013-06-02
    • 1970-01-01
    • 2014-01-22
    • 1970-01-01
    相关资源
    最近更新 更多