The SendToQueue method submits the the WAP Push message to the
message queue (instance of mCore.Queue class returned by
mCore.SMS.Queue method) for sending as SMS to a mobile phone device.
Namespace: mCore
Assembly: mCoreLib (in mCoreLib.dll)
| Name | Description |
| SendToQueue () | Sends the WAP Push message to the message queue with message queue priority set as Normal. |
| SendToQueue (Priority As EnumQueuePriority) | Sends the WAP Push message to the message queue with message queue priority as defined by 'Priority'. |
mCore.WapPushException
mCore.GeneralException
| Visual Basic |
| Public Class MyClass Public WithEvents objSMS As New mCore.SMS Public Sub SendQueue() Dim objWP As mCore.WapPush = objSMS.vCalendar Dim strKey As String = "" Try SetCommParameters() objWP.Destination = "+919873094767" objWP.Text = "Check your emails online" objWP.URL = "http://www.mobulus.com/mobile" objWP.Action = mCore.WapPushAction.SignalMedium objWP.Created = DateTime.Now objWP.Expiry = "1W" If objWP.IsLengthOK Then strKey = objWP.SendToQueue(mCore.QueuePriority.High) MsgBox("WAP Push message added to queue." & vbCrLf & _ "[Queue Key: " & strKey & "]") End If objWP.Destination = "+919810098765" If objWP.IsLengthOK Then 'Following message is sent with normal queue priority strKey = objWP.SendToQueue() MsgBox("WAP Push message added to queue." & vbCrLf & _ "[Queue Key: " & strKey & "]") End If objWP.Destination = "+919811045678" If objWP.IsLengthOK Then strKey = objWP.SendToQueue(mCore.QueuePriority.Low) MsgBox("WAP Push message added to queue." & vbCrLf & _ "[Queue Key: " & strKey & "]") End If 'Message queue is enabled objSMS.Queue.Enabled = True 'Messages can be added to the queue even 'when the Message queue is enabled objWP.Destination = "+919873012345" If objWP.IsLengthOK Then strKey = objWP.SendToQueue(mCore.QueuePriority.High) MsgBox("WAP Push message added to queue." & vbCrLf & _ "[Queue Key: " & strKey & "]") End If Catch ex As mCore.GeneralException MsgBox(ex.Message, MsgBoxStyle.Critical, "mCore Demo") Catch ex As Exception End Try End Sub 'Event at the start of sending a queued WAP Push message Private Sub objSMS_QueueWapPushSending(ByVal sender As Object, _ ByVal e As mCore.QueueWapPushSendingEventArgs) _ Handles objSMS.QueueWapPushSending MsgBox("Sending WAP Push message to: " & e.DestinationNumber & vbCrLf & _ "[Queue Key: " & e.QueueMessageKey & _ "]", MsgBoxStyle.Information, "SENDING WAP PUSH") End Sub 'Event at the end of sending a queued WAP Push message Private Sub objSMS_QueueWapPushSent(ByVal sender As Object, _ ByVal e As mCore.QueueWapPushSentEventArgs) _ Handles objSMS.QueueWapPushSent If e.ErrorCode > 0 Then MsgBox("WAP Push message sending FAILED to: " & e.DestinationNumber & _ vbCrLf & "[ERROR: " & e.ErrorDescription & _ "]" & vbCrLf & "[Queue Key: " & e.QueueMessageKey & _ "]", MsgBoxStyle.Critical, "WAP PUSH FAILED") Else MsgBox("WAP Push message SENT to: " & e.DestinationNumber & vbCrLf & _ "[Queue Key: " & e.QueueMessageKey & _ "]", MsgBoxStyle.Information, "WAP PUSH SENT") End If End Sub Public Sub SetCommParameters() Try objSMS.Port = "COM1" objSMS.BaudRate = mCore.BaudRate.BaudRate_19200 objSMS.DataBits = mCore.DataBits.Eight objSMS.StopBits = mCore.StopBits.One objSMS.Parity = mCore.Parity.None objSMS.FlowControl = mCore.FlowControl.RTS_CTS Catch ex As mCore.GeneralException MsgBox(ex.Message) Catch ex As Exception End Try End Function End Class |
| C# |
class MyClass { SetCommParameters(); catch
(mCore.GeneralException e) catch
(mCore.GeneralException e) |
mCore.SMS.WapPush
Method
WapPush.Destination Property
WapPush.Text Property
WapPush.URL Property
WapPush.Action Property
WapPush.Created Property
WapPush.Expiry Property
WapPush.IsLengthOK Property
mCore.SMS.QueueWapPushSending Event
mCore.SMS.QueueWapPushSent
Event