【发布时间】:2013-02-03 11:23:09
【问题描述】:
我在 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.
【问题讨论】:
-
您的本地 apache 服务器必须设置为发送真实电子邮件。
-
你有这个教程的链接吗?
-
要让@RocketHazmat 回答,您必须向我们提供有关您当地环境的更多信息。你是在 Windows/Mac/Linux 上开发吗?
-
是的,我在 Mac 上。 10.7.5
标签: macos codeigniter localhost email