Hi and welcome to the Python discussion board.
I believe this will wok for you:
Just add whatever you might need to this snipper and it should work.
import inbox, logs, e32, appuifw
#Now you just get whatever info you need. For example, the recipient's number:
print "Message sent to "+str(m["number"])
#Set the inbox as outbox. I know it sounds weird, but it works
#Wait for an outgoing message, and when there is one, call a function to retrieve the info