我在 mac os x apache 2 服务器上使用 codeigniter 的电子邮件库。我遇到的奇怪的事情是,当我在 hostgator.com 上的实时服务器上使用它时,电子邮件会通过,但是当我在本地 apache2 服务器上运行相同的代码时,我没有收到任何电子邮件(即使在垃圾邮件箱中) )。可能是什么问题?这是代码
$this->load->library('email');
$this->email->from('your@example.com', 'Your Name');
$this->email->to('myemailhere@gmail.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
if($this->email->send())
{
var_export($this->email->print_debugger());
}
在本地和实时服务器上,这是 var_dump 数据
'Your message has been successfully sent using the following protocol: mail
From: "Your Name"
Return-Path:
Reply-To: "your@example.com"
X-Sender: your@example.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <5122a6ed242b8@example.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
=?utf-8?Q?Email_Test?=
Testing the email class.