Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHP和debian发送邮件_Php_Email_Postfix Mta - Fatal编程技术网

使用PHP和debian发送邮件

使用PHP和debian发送邮件,php,email,postfix-mta,Php,Email,Postfix Mta,我使用postfix通过PHP邮件功能发送消息。我让它工作了。。。有点。 我遇到的问题是,它的工作非常零散。如果我向我的GMAIL发送邮件,它会以root@hostname. 我在哪里可以换这个?我想把它从conference@mydomain.se. 当我使用“php sendmail.php”发送邮件时,我会在/var/log/mail.log中接收到: Aug 13 13:00:01 CONSERV25 postfix/cleanup[23503]: 6CEA1141037: messag

我使用postfix通过PHP邮件功能发送消息。我让它工作了。。。有点。 我遇到的问题是,它的工作非常零散。如果我向我的GMAIL发送邮件,它会以root@hostname. 我在哪里可以换这个?我想把它从conference@mydomain.se.

当我使用“php sendmail.php”发送邮件时,我会在/var/log/mail.log中接收到:

Aug 13 13:00:01 CONSERV25 postfix/cleanup[23503]: 6CEA1141037: message-id=<20130813110001.6CEA1141037@CONSERV25>
Aug 13 13:00:01 CONSERV25 postfix/qmgr[3937]: 6CEA1141037: from=<>, size=2409, nrcpt=1 (queue active)
Aug 13 13:00:01 CONSERV25 postfix/bounce[23507]: 6B70C141036: sender non-delivery notification: 6CEA1141037
Aug 13 13:00:01 CONSERV25 postfix/qmgr[3937]: 6B70C141036: removed
Aug 13 13:00:02 CONSERV25 postfix/local[23505]: 6CEA1141037: to=<smmsp@example.se>, relay=local, delay=1, delays=0.01/0/0/1, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Aug 13 13:00:02 CONSERV25 postfix/qmgr[3937]: 6CEA1141037: removed
Aug 13:00:01 25后缀/清除[23503]:6CEA11141037:消息id=
Aug 13:00:01 25 postfix/qmgr[3937]:6CEA11141037:from=,size=2409,nrcpt=1(队列活动)
8月13日13:00:01 25后缀/跳出[23507]:6B70C141036:发件人未送达通知:6CEA11141037
八月13日13:00:01:25后缀/qmgr[3937]:6B70C141036:已删除
Aug 13:00:02 25 postfix/local[23505]:6CEA11141037:to=,relay=local,delay=1,delays=0.01/0/0/1,dsn=2.0.0,status=sent(传递给命令:procmail-a“$EXTENSION”)
Aug 13:00:02 25 postfix/qmgr[3937]:6CEA11141037:已删除

首先,我需要一种方法来更改发件人root@hostname到conference@mydomain.se. 我在[mail]下的php.ini中更改了它,但没有效果。

如果在
php.ini中设置
sendmail\u from
无效,请尝试在邮件函数本身中设置自定义“from:”标题。这也将用于设置信封发件人地址。

您能给我们看一下您的代码吗?我注意到,只要不是内部邮件,就可以发送邮件。我不能给你发邮件test@foo.bar到test2@foo.bar但是test@gmail.com.
这是一封简单的邮件($addr、$subj、$mess、$header)