发送电子邮件与CodeIgniter使用'邮件'或'sendmail' [英] Sending email with CodeIgniter using 'mail' or 'sendmail'
本文介绍了发送电子邮件与CodeIgniter使用'邮件'或'sendmail'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
sendmail
或邮件发送这些电子邮件
。 但是,当我将电子邮件配置为:
$ config ['protocol'] ='sendmail';
我得到:
退出状态代码:127
无法打开到Sendmail的套接字。请检查设置。
无法使用PHP Sendmail发送电子邮件。您的服务器可能未配置为使用此方法发送邮件。
,当我使用:
$ config ['protocol'] ='mail';
我得到:
无法使用PHP mail()发送电子邮件。您的服务器可能未配置为使用此方法发送邮件。
有什么我应该在PHP中安装或检入 phpinfo() / code>确定如何使其工作?
解决方案
OK - 这很简单。 >
对于任何面临此问题的人:
- 首先检查sendmail(实际是Postfix)是否安装。我正在使用Ubuntu 11.x。
cd usr / sbin /
- 如果找不到sendmail,则需要安装
sudo apt-get install postfix
- 我接受了对话框的默认选项,一旦安装完成,发送的电子邮件没有问题。
I built an intranet app that needs to send email (low volume). I will not be able to use the SMTP server of my organization, so I need to send these emails via sendmail
or mail
.
However, when I config my email as:
$config['protocol'] = 'sendmail';
I get:
Exit status code: 127
Unable to open a socket to Sendmail. Please check settings.
Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method.
and when I use:
$config['protocol'] = 'mail';
I get:
Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.
Is there anything I should setup in PHP or check in phpinfo()
to figure out how to get this to work?
解决方案
OK - this was simple.
For anyone who faces this issue:
- First check if sendmail (actually Postfix) is installed. I am using Ubuntu 11.x.
cd usr/sbin/
- If you can't find sendmail, then it needs to be installed
sudo apt-get install postfix
- I accepted the default options on the dialogs and once install was complete, emails sent without a problem.
这篇关于发送电子邮件与CodeIgniter使用'邮件'或'sendmail'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文