【发布时间】:2018-07-23 08:23:42
【问题描述】:
我有这样的问题。我想从我的网络应用程序发送邮件,所以我把它放在我的控制器中。
$from_email = "tharuwan40@gmail.com";
$to_email = "warimali94@gmail.com";
//Load email library
$this->load->library('email');
$this->email->from($from_email, 'Info');
$this->email->to($to_email);
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
这个 Web 应用程序仍在本地主机上运行。我在网上尝试了很多示例,这些示例也已在堆栈溢出中发布。但我的邮件上没有任何内容。电子邮件未发送。我该如何解决这个问题?
【问题讨论】:
-
您是否正确设置了首选项? codeigniter.com/userguide2/libraries/email.html
-
检查 $this->email->send() 返回 true 还是 false。也尝试通过 codeigniter 使用 print_debugger()。
-
在localhost中,你是使用smtp还是安装sendmail?
-
我正在使用 smtp
-
$this->email->send() this return false
标签: php codeigniter email