Python Imessage



Whenever we talk about sending an SMS to our phone using any programming language the first thing that comes into our head is Twilio SMS library.But in this post we are going to avoid twilio and use python builtin module SMTPLIB I know it sounds crazy since SMTPLIB is used to send emails but we can also send text messages using that module. In order to send text message to your phone all you need to know is sms-gateway. So every carrier has their own sms-gateways and you can read more about it here SMS GATEWAYS.

SMS Gateways for each Carrier

ImessagePython Imessage

Thanks for the help Camelot. I followed your steps and got a service id for icloud which looks like this. Tell application 'Messages'. Set theBuddy to buddy '+5' of service id 'F7273233-267B-4EB6-851D-49B440B18411'. Py-imessage is a library to send iMessages from your Mac computer (it does not work on Windows/Linux). It was originally used to build an API for iMessages; however, Apple doesn't support third-parties using iMessage over a few hundred marketing messages per day.

  • AT&T: [number]@txt.att.net
  • Sprint: [number]@messaging.sprintpcs.com or [number]@pm.sprint.com
  • T-Mobile: [number]@tmomail.net
  • Verizon: [number]@vtext.com
  • Boost Mobile: [number]@myboostmobile.com
  • Cricket: [number]@sms.mycricket.com
  • Metro PCS: [number]@mymetropcs.com
  • Tracfone: [number]@mmst5.tracfone.com
  • U.S. Cellular: [number]@email.uscc.net
  • Virgin Mobile: [number]@vmobl.com

Python Message Queue

So lets begin writing the script

PythonPython Imessage
  • First we need to import smtplib and MIME module that will help us structure our message by the you can read more about MIME here Multipurpose Internet Mail Extensions (MIME)
Python messagepack

So this was our simple python script that will allow you to send text messages to your phone. I hope you enjoyed this post if you think i missed any thing feel free to dm me on twitter

Python Message Queue Redis

Furthermore, here's the python module that I wrote that allows you to send text messages without twilio.
termtext
Checkout my Website