发送带有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();
}
您的邮件已使用以下协议成功发送:mail
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
答案 0 :(得分:0)
您是否设置了电子邮件配置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);