A Python package for sending messages through the macOS Messages app.
- Send iMessages and SMS
- Automatic fallback from iMessage to SMS
- Delivery status checking
- Comprehensive error handling
pip install git+https://github.com/christo4b/imessage_utils.git
from imessage_utils import IMessageSender
sender = IMessageSender()
# Try iMessage with SMS fallback
success = sender.send("+1234567890", "Hello!")
# SMS only
success = sender.send_sms("+1234567890", "Hello via SMS!")
# iMessage only
success = sender.send_imessage("+1234567890", "Hello via iMessage!")
# Install locally
pip install -e .
# Normal send (tries iMessage, falls back to SMS)
python test_usage.py "+1234567890" "Hello world"
# SMS only
python test_usage.py --sms-only "+1234567890" "Hello via SMS"
# iMessage only
python test_usage.py --imessage-only "+1234567890" "Hello via iMessage"
- macOS with Messages app configured
- Python 3.7+
- Clone the repository
- Install development dependencies:
pip install -r requirements.txt
- Run tests:
pytest tests/
Apache 2.0