PHP error with mailserver “ Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0” in context to email

巧了我就是萌 提交于 2020-01-05 03:37:17

问题


I am setting up a localhost PHP server to play around with mailservers. I have my php.int all set up with my provider's info and have a seemingly valid php file that I am trying to run: (info changed, for obvious reasons.)

<?php
$to = 'example@gmail.com';
    $headers = "";
    $headers .= "From: WIFI Metropolis <sitename@hostname.com> \r\n";

    mail ($to, string, string , $headers);
?>

When navigate to this file (new.php), i get this error:

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Unknown: Failed opening required 'folder' (include_path='.;C:\php\pear') in Unknown on line 0

I am new to php, so could anyone help me find a solution to this issue?
Thanks!

来源:https://stackoverflow.com/questions/37427612/php-error-with-mailserver-warning-unknown-failed-to-open-stream-no-such-fil

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!