working with text message text messages represent the most efficient and least resource-intensive method of sending communication howevertext messages also convey the least amount of information yesyou can use emoticons to help get the point acrossbut the lack of formatting can become problem in some situations the following steps describe how to create simple text message using python this example also appears with the downloadable source code as textmessage py open python file window you see an editor in which you can type the example code type the following code into the window -pressing enter after each linefrom email mime text import mimetext import smtplib msg mimetext("hello there!"msg['subject'' test messagemsg['from']='senderaddressmsg['to''recipientaddresss smtplib smtp('localhost' sendmail('senderaddress'['recipientaddress']msg as_string()print("message sent!"this example is combination of everything you've seen so far in the howeverthis is the first time you've seen everything put together notice that you create the message firstand then the envelope (just as you would in real life choose runrun module the application tells you that it has sent the message to the recipient