从另一个文件运行PHP文件

I have a script on my server send sends email. and shows a response as 0 or 1

Here is the URL :

 http://examplewebsite.com/emailsender.php?to=$to&subject=$subject&message=$message

I am punting data in $to,$messages,$header.And it's sending the email.

I need to get the response of the page too.

How can i do that?

use file_get_contents or curl to get the output:

$output = file_get_contents(" http://smwebtech.com/webservices/emailsender.php?to=$to&subject=$subject&message=$message");

In PHP there are a number of ways. The easiest is file_get_contents() (which supports URL wrappers), or if you want a bit more power but more setup you can use CURL.

<?php
  $response = file_get_contents('http://smwebtech.com/webservices/emailsender.php?to=$to&subject=$subject&message=$message');
  var_dump($response);
?>

The URL can be called with file_get_contents() or cURL, both will give you the resulting HTML.

You should implement some sort of security to prevent people abusing your email script, such as an IP whitelist.