note 39846 added to ref.com
| From: | platiumstar at canada dot com | Date: | Thu, 12 Feb 2004 20:08:24 +0000 |
| Subject: | note 39846 added to ref.com | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65060@lists.php.net to get a copy of this message | ||
I didn't found any working examples of PHP using the MSMQ COM object, so I made up one, thought
I share it with everybody..it works ok.
You have to create a local Public message queue named "TestQueue" first.
define(MQ_SEND_ACCESS , 2);
define(MQ_DENY_NONE , 0);
$msgQueueInfo = new COM("MSMQ.MSMQQueueInfo") or die("can not create MSMQ Info
object");
$msgQueueInfo->PathName = ".\TestQueue";
$msgQueue = new COM("MSMQ.MSMQQueue") or die("can not create MSMQ object");
$msgQueue=$msgQueueInfo->Open(MQ_SEND_ACCESS, MQ_DENY_NONE );
$msgOut = new COM("MSMQ.MSMQMessage") or die("can not create MSMQ message
object");
$msgOut->Body = "Hello world!";
$msgOut->Send($msgQueue);
$msgQueue->Close();
unset($msgOut);
unset($msgQueue);
unset($msgQueueInfo);
enjoy
PS
----
Manual Page -- http://www.php.net/manual/en/ref.com.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39846
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39846&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39846&report=yes
Search -- http://master.php.net/manage/user-notes.php