How can I send email by Outlook software installed on client systems by PHP?
Can I use PHPMailer and set host to local Outlook software? Or should I use JavaScript to send email, when Outlook opened on system?
I used this PHP code and return error:
if (!defined("olMailItem")) {define("olMailItem",0);}
$oApp = new COM("Outlook.Application") or die('error');
$oMsg = $oApp->CreateItem(olMailItem);
$oMsg->Recipients->Add("mk.kardgar@gmail.com");
$oMsg->Subject=$subject;
$oMsg->Body=$message;
$oMsg->Save();
$oMsg->Send();
error:
Fatal error: Uncaught com_exception: Failed to create COM object Outlook.Application': Invalid syntax in C:\projects\ccs\modules\callReview\admin\just\cancellation\ajax\sendEmailCancellation.php:15 Stack trace: #0 C:\projects\ccs\modules\callReview\admin\just\cancellation\ajax\sendEmailCancellation.php(15): com->com('Outlook.Applica...') #1 C:\projects\ccs\admin\just.php(26): include('C:\\projects\\ccs...') #2