Quicklinks
The MmsProtocolMm1 object provides functionality to connect to an MMS provider over GPRS and deliver an MMS message. To be able to connect to an MMSC provider, you need a GSM/GRPS modem with a GPRS subscription to a provider.
To connect to the MMS provider using a GSM/GPRS modem, the following steps are taken:
The SmsProtocolHttp object is part of the ActiveXperts SMS and MMS Toolkit component. Overview of all SMS and MMS Toolkit objects:
Set objMm1Protocol = CreateObject("ActiveXperts.MmsProtocolMm1")
Set objMmsMessage = CreateObject("ActiveXperts.MmsMessage")
Set objMmsSlide = CreateObject("ActiveXperts.MmsSlide")
Set objConstants = CreateObject("ActiveXperts.MmsConstants")
' MmsSlide: Add duration, attachments(s) and text(s)
objMmsSlide.Clear()
objMmsSlide.Duration = 10 ' Display this screen for 10 seconds
objMmsSlide.AddAttachment( "logo.gif" ) ' Add a multimedia attachment
objMmsSlide.AddText( "The ActiveXperts logo" ) ' Add a description
' MmsMessage: Set properties
objMmsMessage.Clear() ' Clear the message object (good practise)
objMmsMessage.Subject = "My Message" ' Subject of the message
objMmsMessage.AddRecipient( "+4412345678" ) ' MMS recipient; phone/e-mail addresses allowed
' MmsMessage: Add slide
objMmsMessage.AddSlide( objMmsSlide ) ' Add slide to the message; multiple slides allowed
' MMS Connection: Set device
objMm1Protocol.Device = "Falcom SAMBA 75 GSM/GPRS Modem" ' Set GSM/GPRS modem
' MMS Connection: Set provider properties (see also www.activexperts.com/xmstoolkit/mmsclist)
objMm1Protocol.ProviderAPN = "wap.vodafone.co.uk" ' Provider's Access Point Name
objMm1Protocol.ProviderAPNAccount = "" ' Provider login (not required for all providers)
objMm1Protocol.ProviderAPNPassword = "" ' Provider password (not required for all providers)
objMm1Protocol.ProviderWAPGateway = "212.183.137.12" ' Provider's WAPgateway address
objMm1Protocol.ProviderMMSC = "mms.vodafone.co.uk/servlets/mms" ' MMS Server Provider Center address
objMm1Protocol.Connect() ' Connect
If ( objMm1Protocol.LastError <> 0 ) Then
WScript.Quit
End If
objMm1Protocol.Send ( objMmsMessage ) ' Send message incl. slide(s)
objMm1Protocol.Disconnect() ' Disconnect
Imports AMmsCtrl Module Module1 Sub Main() Dim objMm1Protocol As MmsProtocolMm1 = New MmsProtocolMm1 Dim objMmsMessage As MmsMessage = New MmsMessage Dim objMmsSlide As MmsSlide = New MmsSlide Dim objConstants As MmsConstants = New MmsConstants ' MMSlide: Add duration, attachments(s) and text(s) objMmsSlide.Clear() objMmsSlide.Duration = 10 ' Display this screen for 10 seconds objMmsSlide.AddAttachment("logo.gif") ' Add a multimedia attachment objMmsSlide.AddText("The ActiveXperts logo") ' Add a description ' MmsMessage: Set properties objMmsMessage.Clear() ' Clear the message object (good practise) objMmsMessage.Subject = "My Message" ' Subject of the message objMmsMessage.AddRecipient("+4412345678") ' MMS recipient; phonenumber/ e-mail allowed ' MmsMessage: Add slide objMmsMessage.AddSlide(objMmsSlide) ' Add slide; multiple slides allowed ' MMS Connection: Set device objMm1Protocol.Device = "Falcom SAMBA 75 GSM/GPRS Modem" ' Set GSM/GPRS modem ' MMS Connection: Load provider properties objMm1Protocol.ProviderLoadConfig("C:\Program Files\ActiveXperts\MMS Toolkit\Mmsc\Mm1\UK\Vodafone.mm1") ' MMS Connection: Connect objMm1Protocol.Connect() ' MMS Connection: Send the MmsMessage, including one or more slides objMm1Protocol.Send(objMmsMessage) Console.WriteLine("Send, result: " & objMm1Protocol.LastError.ToString ' MMS Connection: Disconnect objMm1Protocol.Disconnect() End Sub End Module
Samples are available for: Visual Basic, Visual C/C++, VB .NET, VC# .NET, ASP, ASP .NET, Borland C++ Builder, Boland Delphi, ColdFusion, Java, Javascript, PHP, HTML and more.
On ftp.activexperts-labs.com, you can find many SMS and MMS Toolkit samples. Samples are also part of the SMS and MMS Toolkit installation.