Shortcut Menu

Skip

Main Navigation

Choose your language

You are here:

ActiveXperts.com > SMS and MMS Toolkit > Objects > MmsProtocolMm1

ActiveXperts SMS and MMS Toolkit Add SMS and MMS capabilities to any Windows or .NET application

SMS and MMS Toolkit - MmsProtocolMm1 object

Overview

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:

  • A RRAS connection is established to the provider. To establish this connection, the provider's Access Point Name (APN) is required. Optionally, the APN login and password are required (only if the provider requires authentication);
  • When the RRAS connection is established, a dynamic IP address is assigned, for instance: 10.68.0.73;
  • The provider has a fixed WAP gateway address, for instance: 10.250.255.183. To allow access to this IP address, the routing entry is added to the local routing table, to tell that 10.250.255.183 should be routed via 10.68.0.73;

The SmsProtocolHttp object is part of the ActiveXperts SMS and MMS Toolkit component. Overview of all SMS and MMS Toolkit objects:

  • SmsProtocolGsm - Send and receive SMS messages using a GSM modem or a modem-capable GSM phone.
  • SmsProtocolSmpp - Send and receive SMS messages via an SMPP provider.
  • SmsProtocolHttp - Send (bulk) SMS messages through an SMS/HTTP compliant SMS provider over the internet/VPN.
  • SmsProtocolDialup - Send SMS messages using a normal Hayes compatible modem (1200 bps or higher).
  • MmsProtocolMM1 - Send and receive MMS messages via a GPRS modem through WAP (wireless application protocol).
  • MmsProtocolMM4 - Send MMS messages via an SMTP server. The protocol is based on SMTP, messages are MIME encoded.
  • MmsProtocolMM7 - Send and receive MMS messages via SOAP/XML using HTTP as the transport protocol.
  • PagerProtocolSnpp - Send pager messages via an SNPP provider through the internet/VPN.

Sample code

VBScript sample: Send an MMS message using a GSM/GPRS modem

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

VB .NET sample: Send an MMS message using a GSM/GPRS modem

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

More samples

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.