-->

PHP error with mailserver “ Warning: Unknown: fail

2019-07-29 23:42发布

问题:

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!