To send an email by using mail() use the following code in any .php test file for example create a file test.php and use the following code in test.php file
PHP Code:
$to = 'test@yahoo.com';
$subject = 'The test for mail function';
$message = 'Hello';
$headers = 'From: test@testforever.com' . "\r\n" .
'Reply-To: test@testforever.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
The above code will send an email after browsing
http://yourdomain.com/test.php at
test@yahoo.com from
test@testforever.com with the content "Hello" and subject "The test for mail function".