Dear All
Has any one had any success creating an olMailItem with Apache/PHP on Windows 2000 and the full version of Outlook 98 (not express).
The program fails at the point at which it creates the olMailItem, and I can't figure out why. Can any one show me where I'm going wrong and/or show me abetter way to do it?
Many thanks
Paul
My code is as follows :
<?php
$objApp = new COM("Outlook.Application");
#Get the application name and version
print "Application name: {$objApp->Application->name}<br />" ;
print "Loaded version: {$objApp->Application->version}<br />";
$myItem = $objApp->CreateItem("olMailItem");
$a=$myItem->Recipients->Add("paul.rogers@mowlem.com");
$myItem->Subject="Test the PHP/COM with Outlook";
$myItem->Body="This is a Body Section now.....!";
$myItem->Display();
$myItem->Send();
The output is as follows :
Application name: Outlook
Loaded version: 8.5.5104.6
Warning: Invoke() failed: Type mismatch. Argument: 2 in c:\data\apache\htdocs\testoutlook.php on line 9
Fatal error: Call to a member function on a non-object in c:\data\apache\htdocs\testoutlook.php on line 10