CodeIgniter无法使用PHP邮件发送电子邮件() [英] CodeIgniter unable to send email using PHP mail()

查看:3688
本文介绍了CodeIgniter无法使用PHP邮件发送电子邮件()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Codeigniter发送电子邮件,例如:

I'm trying to send an e-mail with Codeigniter like this:

$this->load->library('email');

$this->email->from("myemail@email.com");
$this->email->reply_to("myemail@email.com");
$this->email->to("myemail@email.com");
$this->email->subject("Test mail");
$this->email->message("Email body");
$this->email->set_alt_message("Email body txt");
$this->email->send();

我在电子邮件调试器上得到:无法使用PHP邮件您的服务器可能未配置为使用此方法发送邮件。

and I got this on the email debugger: Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.

如果我使用相同地址的简单PHP mail()函数,它可以正常工作,但是当我使用CodeIgniter它给我的错误。那么为什么它将与简单的mail()而不是与CodeIgniter工作?任何想法?

If I do e simple PHP mail() function with the same addresses, it works but when I use CodeIgniter it gives me the error. So why would it work with simple mail() but not with CodeIgniter ? Any ideas ?

感谢。

推荐答案

.php文件在你的config文件夹中?也许您的配置有问题。

Do you have an email.php file in your config folder? Maybe there's a problem with your configuration in there.

这篇关于CodeIgniter无法使用PHP邮件发送电子邮件()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆