代码点火器邮件功能不起作用


Codeigniter mail function not working

我在使用codeigniter的邮件功能发送电子邮件时遇到问题。在我的所有 CI 网站上,除了 nordia.be 之外,相同的代码都有效。我的所有网站都在同一个提供商上,我用一个简单的 php 邮件表单进行了测试,这有效!有什么建议吗?这是我的代码。奇怪的是它已成功发送,但我没有收到邮件?

function sendmail2(){
    $message = "Aanvraag van: ".$this->input->post('inputName')."'r'n";
    $message .= "Telefoon nr: ".$this->input->post('inputTel')."'r'n";
    $message .= "Email: ".$this->input->post('inputEmail')."'r'n'r'n";
    $message .= "Bericht: ".$this->input->post('inputBericht')."'r'n'r'n";
    $this->load->library('email');
    $this->email->from($this->input->post('inputEmail'),$this->input->post('inputName'));
    $this->email->to('kristof@email.be');
    $this->email->subject('nordia vraag!');
    $this->email->message($message);
    $this->email->send();
    echo $this->email->print_debugger();
}

您的邮件已成功使用以下协议发送:邮件

User-Agent: CodeIgniter
Date: Thu, 8 Jan 2015 12:03:50 +0000
From: "sds" <kristof@kspl.be>
Return-Path: <kristof@kspl.be>
Reply-To: "kristof@kspl.be" <kristof@kspl.be>
X-Sender: kristof@kspl.be
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <54ae72265f227@kspl.be>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
=?iso-8859-1?Q?nordia_vraag!?=
Aanvraag van: sds
Telefoon nr: dsdsd
Email: kristof@kspl.be
Bericht: sds

您是否设置了电子邮件配置 http://www.codeigniter.com/user_guide/libraries/email.html

您需要添加电子邮件配置才能使其正常工作。

另外,如果您在这里使用xampp或wampp,您可以观看教程。 https://www.youtube.com/watch?v=TO7MfDcM-Ho

$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$this->email->initialize($config);