note 39846 deleted from ref.com by cmb
| From: | cmb@php.net | Date: | Sun, 30 Jun 2019 07:47:30 +0000 |
| Subject: | note 39846 deleted from ref.com by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211417@lists.php.net to get a copy of this message | ||
Note Submitter: platiumstar at canada dot com
----
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.
<?php
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