问题描述
更新:我解决了记录下面的一切。
我尝试了这么多东西,但是它不会奏效。
我不介意使用,postfix,exim4或sendmail。我只需要一步一步的指导和解释我在做什么。我也在使用Google Apps进行电子邮件。
编辑:
mail.log
Nov 3 01:14:02 mugbear postfix [16615]:错误:提交邮件,使用Postfix sendmail命令
Nov 3 01:14:02 mugbear postfix [16615]:致命:postfix命令为超级用户保留
这是什么意思?
更新编辑:修正php.ini中的sendmail_path与 sendmail_path = / usr / sbin / sendmail -t -i
编辑2:
PHP - 只需从文档中获取。 FYI,我删除了我的电子邮件。
<?php
//消息
$ message =Line 1\\\
Line 2\\\
Line 3;
//如果我们的任何行大于70个字符,我们应该使用wordwrap()
$ message = wordwrap($ message,70);
//发送
mail([email protected]','我的主题',$ message);
?>
Edit3:
另一个错误:
Nov 3 07:22:29 mugbear postfix / postdrop [17131]:警告:无法查找public / pickup:没有这样的文件或目录
11月3日07:22:29 mugbear postfix / postdrop [17133]:警告:无法查找公共/拾取:没有这样的文件或目录
更新到edit3:使用以下链接修复此问题:
运行这个:
sudo mkfifo / var / spool / postfix / public / pickup
pre>
sudo /etc/init.d/postfix restart
之后,您会收到此错误:
postfix / master [13902]:fatal:bind 0.0.0.0 port 25:Address already in use
然后您将必须检查您的进程并终止sendmail进程,例如:
root @ server:/ etc / postfix#ps aux | grep mail
root 23554 0.0 0.0 8232 1900? Ss 10:17 0:00 sendmail:MTA:接受连接
root 27308 0.0 0.0 3004 764 pts / 0 S + 10:30 0:00 grep mail
root @ server:/ etc / postfix#kill 23554
Edit4:
这是什么意思? >
Nov 3 07:34:51 mugbear postfix / pickup [17309]:6602F1C151:uid = 33 from =< www-data>
Nov 3 07:34:51 mugbear postfix / cleanup [17311]:6602F1C151:message-id =< [email protected]>
Nov 3 07:34:51 mugbear postfix / qmgr [17310]:6602F1C151:from =< [email protected]> size = 397,nrcpt = 1(queue active)
Nov 3 07:34:51 mugbear postfix / error [17321]:6602F1C151:to =< [email protected]> relay = none,delay = 0.03,延迟= 0.02 / 0/0 / 0.01,dsn = 4.3.5 ,status = deferred(发送暂时挂起:找不到主机或域名)name = xen.prgmr.com的名称服务错误type = A:找到的主机但没有请求类型的数据记录
更新到edit4:我跑了,
dpkg-reconfigure postfix
并选择
Internet站点
。解决方案正确安装postfix?如果是的话:
service postfix restart
nano /etc/php.ini
查找sendmail_path,将行更改为sendmail_path = /usr/sbin/sendmail.postfix -t -i
以下是php客户端的完整服务器/客户端安装说明还
遵循客户端安装说明...
Update: I solved it. Documented everything below.
I tried so many things, but it just would not work.
I wouldn't mind using, postfix, exim4, or sendmail. I just need a step by step guide and explanation of what am I doing. I am also using Google Apps for e-mail.
Edit:
mail.log
Nov 3 01:14:02 mugbear postfix[16615]: error: to submit mail, use the Postfix sendmail command Nov 3 01:14:02 mugbear postfix[16615]: fatal: the postfix command is reserved for the superuser
What does this mean?
Update to edit: Fixed by correcting sendmail_path in php.ini with
sendmail_path = /usr/sbin/sendmail -t -i
Edit2:PHP - Just grabbed from documentation. FYI, I removed my e-mail.
<?php // The message $message = "Line 1\nLine 2\nLine 3"; // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); // Send mail('[email protected]', 'My Subject', $message); ?>
Edit3:Another error:
Nov 3 07:22:29 mugbear postfix/postdrop[17131]: warning: unable to look up public/pickup: No such file or directory Nov 3 07:22:29 mugbear postfix/postdrop[17133]: warning: unable to look up public/pickup: No such file or directory
Update to edit3: Fixed this with the following link: http://ubuntuforums.org/showthread.php?t=666018Run this:
sudo mkfifo /var/spool/postfix/public/pickup sudo /etc/init.d/postfix restart
After that, you'll get this error:
postfix/master[13902]: fatal: bind 0.0.0.0 port 25: Address already in use
Then you will have to check your processes and kill sendmail processes, for example:
root@server:/etc/postfix# ps aux | grep mail root 23554 0.0 0.0 8232 1900 ? Ss 10:17 0:00 sendmail: MTA: accepting connections root 27308 0.0 0.0 3004 764 pts/0 S+ 10:30 0:00 grep mail root@server:/etc/postfix# kill 23554
Edit4:What does this mean?
Nov 3 07:34:51 mugbear postfix/pickup[17309]: 6602F1C151: uid=33 from=<www-data> Nov 3 07:34:51 mugbear postfix/cleanup[17311]: 6602F1C151: message-id=<[email protected]> Nov 3 07:34:51 mugbear postfix/qmgr[17310]: 6602F1C151: from=<[email protected]>, size=397, nrcpt=1 (queue active) Nov 3 07:34:51 mugbear postfix/error[17321]: 6602F1C151: to=<[email protected]>, relay=none, delay=0.03, delays=0.02/0/0/0.01, dsn=4.3.5, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=xen.prgmr.com type=A: Host found but no data record of requested type)
Update to edit4: I ran,
dpkg-reconfigure postfix
and selectedInternet Site
.解决方案did you properly installed postfix ? If yes : service postfix restart
nano /etc/php.ini
Find sendmail_path , change the line to sendmail_path = /usr/sbin/sendmail.postfix -t -i
Here is the complete server / client installation instructions for php client also http://setahost.com/installing-postfix-as-a-default-mail-sending-program-with-php/
follow client installation instructions ...
这篇关于如何使PHP邮件()工作?需要帮助配置MTA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!