Skip to content

Instantly share code, notes, and snippets.

@seagoj
Created June 3, 2014 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seagoj/cadaf05d352bcf4cf89e to your computer and use it in GitHub Desktop.
Save seagoj/cadaf05d352bcf4cf89e to your computer and use it in GitHub Desktop.
PHP:MSMQ
<?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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment