开发者

php mail() set hostname on windows

Using the PHP mail() function is it possible to set a fully-qualified hostname for mail requests? The development environment is using Windows and using a Postfix mail server specified in php.ini using the SMTP directive.

The problem is PHP is not using a fully-qualified hostname and I'm getting an error message like this:

SMTP server response: 504 5.5.2 <pygorex1-COMPUTERNAME>: Helo command rejected: need fully-qualified hostname
开发者_JS百科

Or perhaps this is a Postfix problem?


mail() itself does not, but have you considered ini_set()? You can use that to set the value for your SMTP server for just the currently executing script.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜