mardi 29 avril 2014

Send a mail using Outlook 2010 from php


Vote count:

0




I'm trying to send a Mail via the installed Outlook 2010 Client from my PHP application So far I've tried this suggestion, the top rated answer didn't work for me. Then I added


[COM_DOT_NET] extension=php_com_dotnet.dll


at the end of php.ini (C:/xampp/php). I also checked my registry for EnableDCOM, it is set to 'Y'.


This is the code I' using:



<?php
if (!defined("olMailItem")) {define("olMailItem",0);}
$oApp = new COM("Outlook.Application") or die('error');
$oMsg = $oApp->CreateItem(olMailItem);
$oMsg->Recipients->Add("xxx@xxx.org");
$oMsg->Subject=$subject;
$oMsg->Body=$message;
$oMsg->Save();
$oMsg->Send();
?>


The full error msg:


Warning: Uncaught exception 'com_exception' with message 'Failed to create COM object `Outlook.Application': Aufruf wurde durch Aufgerufenen abgelehnt. ' in C:\projekt_dreiskaen\mailtest.php:3 Stack trace: #0 C:\projekt_dreiskaen\mailtest.php(3): com->com('Outlook.Applica...') #1 {main} thrown in C:\projekt_dreiskaen\mailtest.php on line 3


Fatal error: Maximum execution time of 30 seconds exceeded in...


Any help would be appreciated :)



asked 2 mins ago






Aucun commentaire:

Enregistrer un commentaire