如果我们使用简单的mail()函数在我的服务器中发送电子邮件,但不是使用 Codeigniter 的以下代码发送的。
$this->load->library('email');
$this->email->from('your@example.com', 'Your Name');
$this->email->to('someone@example.com');
$this->email->cc('another@another-example.com');
$this->email->bcc('them@their-example.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
背后的问题是什么?解决方案是什么?提前谢谢。干杯
print_debugger() 的结果:
Unable to send email using PHP mail().
Your server might not be configured to send mail using this method.
From: "My Site" Return-Path:
Reply-To: "info@mysitedomain.com"
X-Sender: info@mysitedomain.com
X-Mailer: CodeIgniter X-Priority: 3 (Normal)
Message-ID: <66751b444845099d@mysitedomain.com>
Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
=?utf-8?Q?test_email_sending.?= Test email message.