this is my code to open outlook application using com in php.it works fine in local but not working in server.
$objApp = new COM("Outlook.Application") or die("Couldnot instatntiij");

$myItem = $objApp->CreateItem(0);

$myItem->To='recip@ient.com';

$myItem->SentOnBehalfOfName = 'from@address.com';

$myItem->Subject="This is a test";

$myItem->Body="This is a Body Section now.....!";

$myItem->Display();

    Is error_reporting set to E_ALL and display_errors set to On? If so, what PHP errors are you getting? If not, why not? Check [man]phpinfo/man to verify the current value of both of these directives.

    Are you sure that the server has Outlook installed on it (which would also answer the question: Are you sure the server is even running the Windows OS)?

      yes outllook is installed and i cannot find where the php.ini is located on the server through ftp.yes the server is running window .

        Is this com function only capable of opening an instance of the application on the server. I want to be able to open excel on the client pc. Thanks in advance. i have a code like this which works on local like localhosts/cms but not in www.cms.np.
        my code is

        $objApp = new COM("Outlook.Application") or die("Couldnot instatntiij");

        $myItem = $objApp->CreateItem(0);

        $myItem->To='recip@ient.com';

        $myItem->SentOnBehalfOfName = 'from@address.com';

        $myItem->Subject="This is a test";

        $myItem->Body="This is a Body Section now.....!";

        $myItem->Display();

          nivahada;10996305 wrote:

          Is this com function only capable of opening an instance of the application on the server.

          Well yes, of course it is; otherwise, you could have malicious website opening random applications on your PC... an obvious security risk.

            PHP is run on the server, so unless the server is the same machine as the client, then no.

              Write a Reply...