我已经使用下面的代码通过 PHP COM 方法打开 Outlook。但是前景没有打开,它正在加载和加载。没有反应,没有打开前景,只有加载和加载。请给出如何通过 PHP COM 方法打开 Outlook 的解决方案。我已经安装了 Office Outlook,也有 MAPI.Session,也有 Outlook.Application。
if (! defined ( "olMailItem" ))
{
define ("olMailItem", 0 );
}
try {
$objApp = new COM ( "Outlook.Application" ) or die ( "Cannot Load Outlook.Application" );
$namespace = $objApp->GetNamespace("MAPI");
$namespace->Logon();
$myItem = $objApp->CreateItem ( olMailItem );
$myItem->To = "yusuf.khalil88@gmail.com";
$myItem->SentOnBehalfOfName = "yusuf_khalil88@yahoo.com";
$myItem->Subject = "Hi Response me";
$myItem->Body = "I want to find out";
$myItem->Send ();
}catch ( Exception $e ) {
var_dump ( $e->getMessage () );
debug_print_backtrace ();
}