RelaySMS Email Bridge enables users to send emails when they don’t have direct access to their email account but need to communicate. The tool uses the sender’s phone number as an email alias. The email is relayed to the recipient with the sender’s phone number as the prefix and the bridge server’s hostname as the domain (e.g., 237123456789@relaysms.me
). This allows the recipient to identify the sender based on their phone number.
Before you begin, ensure you have:
- Python 3.10+ installed.
- Python
venv
module for creating virtual environments (included in Python 3.3+). Learn more. - A valid SimpleLogin account.
-
Clone the repository:
git clone https://github.com/smswithoutborders/email-bridge.git cd email-bridge
-
Set up a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
Set the required environment variables, either in a
.env
file or directly in your shell:SL_API_KEY
: SimpleLogin API key.SL_API_BASE_URL
: (default:https://app.simplelogin.io/api
).SL_PRIMARY_EMAIL
: Your primary SimpleLogin email.SL_PRIMARY_DOMAIN
: Your SimpleLogin domain.BRIDGE_SMTP_SERVER
: SMTP server address linked toSL_PRIMARY_EMAIL
.BRIDGE_SMTP_PORT
: SMTP server port (default:587
).BRIDGE_SMTP_USERNAME
: Your SMTP username.BRIDGE_SMTP_PASSWORD
: Your SMTP password.BRIDGE_SMTP_ENABLE_TLS
: Enable TLS (default:True
).
Example:
export SL_API_KEY="your-api-key" export SL_PRIMARY_EMAIL="you@example.com" export SL_PRIMARY_DOMAIN="example.com" export BRIDGE_SMTP_SERVER="smtp.example.com" export BRIDGE_SMTP_PORT=587 export BRIDGE_SMTP_USERNAME="your-username" export BRIDGE_SMTP_PASSWORD="your-password"
This client uses SimpleLogin to manage aliases and reverse aliases for sending emails.
To send an email using a phone number alias, use the following command:
python3 -m simplelogin.client send_email \
--phone_number +237123456789 \
--to recipient@example.com \
--subject "Subject Here" \
--body "Email body content here." \
[--cc cc@example.com] \
[--bcc bcc@example.com]
--phone_number
: The phone number to generate or retrieve an email alias.--to
: Recipient’s email address.--subject
: Email subject.--body
: Email body content.--cc
: (Optional) CC email address.--bcc
: (Optional) BCC email address.
python3 -m simplelogin.client send_email \
--phone_number +237123456789 \
--to recipient@example.com \
--subject "Greetings" \
--body "Hello, this is a test email."
Set the log level by configuring the LOG_LEVEL
environment variable. Default is INFO
.
To contribute:
- Fork the repository.
- Create a feature branch:
git checkout -b feature-branch
. - Commit your changes:
git commit -m 'Add a new feature'
. - Push to the branch:
git push origin feature-branch
. - Open a Pull Request.
This project is licensed under the GNU General Public License (GPL). See the LICENSE file for details.