Availability: S60.
The messaging module offers APIs to messaging services. Currently, the messaging module has functions:
| number, msg, [encoding='7bit', callback=None, name=""]) | 
Sends an SMS message with body text msg4.4 (Unicode)to telephone number number (string).
The optional parameter encoding is used to define encoding in the message. 
The parameter values can be '7bit', '8bit' or 'UCS2'.
The optional parameter callback is invoked with the current status of the 
send operation as parameter. The possible states are data items in the module 
messaging. Invoking another send while a previous send request is ongoing 
will result in RuntimeError being raised.
If the callback is not given, the sms_send function will block until the 
message in the queue is either deleted or the sending has failed4.5.
The optional parameter name will be shown in the sent item message entry as recipient's name after successfully sending message to number. If this parameter is not specified, then the recipient's phone number will be shown in the sent item message entry4.6.
| number, msg, [attachment=None]) | 
Sends an MMS message with body text msg (Unicode) to telephone number number (string). The optional parameter attachment is full path to e.g. image file attached to the message.
The following data items for SMS sending state information are available in 
the module messaging:
sms_send operation has finalized and subsequent SMS sending is possible.
sms_send operation has finalized and 
subsequent SMS sending is possible.
sms_send operation has finalized and 
subsequent SMS sending is possible.
The underlying messaging subsystem in S60 devices might give error messages to the user if the device is not connected to a network while trying to send a message - An "SMS send failed!" note is a common error message.
When sending messages in offline-mode or with no network connection these 
messages are actually added to an outgoing message queue and they might be sent 
if the device is later on connected to a suitable network4.7. This occurs despite the 
possibly misleading error messages. The current network conditions can be 
checked e.g. with sysinfo.active_profile() and 
sysinfo.signal_bars() invocations.
The following is example code for state information processing with 
sms_send operation:
>>> import messaging
>>>
>>> def cb(state):
...   if state==messaging.ESent:
...     print "**Message was sent**"
...   if state==messaging.ESendFailed:
...     print "**Something went wrong - Truly sorry for this**"
...
>>> messaging.sms_send("1234567", "Hello from PyS60!", '7bit', cb, "Mary")
>>> **Message was sent** # This is printed from the callback