A utility designed to simplify the process of sending formatted emails through an SMTP server.
Project description
📧 MailBuddy
Welcome to the MailBuddy Library! This is a Python utility designed to make sending formatted emails a breeze! With support for both plain text and HTML email bodies, dynamic content injection, and easy SMTP server configuration, MailBuddy takes the hassle out of email composition. 🎉
🚀 Features
- SMTP Server Configuration: Easily set up your SMTP server with the
hostandportparameters. - Flexible Email Body Input: Add email bodies as plain text, HTML, or even read from files.
- Dynamic Content Injection: Use format variables to personalize your email content.
- Easy Email Sending: Send emails with a single method call.
🛠️ Installation
Clone the repository:
git clone https://github.com/daftscientist/MailBuddy.git
Navigate to the project directory:
cd MailBuddy
🌟 Usage
Here's a quick example to get you started:
from MailBuddy import Email
# Create an email object
email = Email(
host='smtp.example.com',
port=587,
sender='sender@example.com'
)
# Add email body
email.add_plain_body('Hello, {name}!')
email.add_html_body('<h1>Hello, {name}!</h1>')
email.add_format_variables({'name': 'Alice'})
# Send the email
email.send(
recipient='recipient@example.com',
subject='Greetings'
)
📋 Method Details
Email(host: str, port: int, sender: str): Initializes theEmailobject with SMTP server details and the sender's email address.add_html_body_from_file(file_path: str): Adds an HTML body to the email from a file.add_format_variables(format_variables: dict): Adds a dictionary of variables for formatting the email body, with the item to be replaced as the key.add_html_body(html_body: str): Adds an HTML body to the email.add_plain_body(self, plain_body: str): Adds a plain text body to the email.send(self, recipient: str, subject: str): Composes and sends the email. Therecipientparameter is the email address of the person receiving the email.
💬 Contributing
We welcome contributions! Feel free to open issues or submit pull requests. Let's make MailBuddy even better together! 🤝
📜 License
This project is licensed under the MIT License. See the LICENSE file for details.
📧 Contact
For any questions or suggestions, feel free to open an issue or reach out via email at contact@leojohnston.tech .
Happy emailing! 🚀📧✨
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mailbuddy-0.1.4.tar.gz.
File metadata
- Download URL: mailbuddy-0.1.4.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d64e5fe172b6e8cffc23b14eac1945f0ff785149e87e4a25886f3130b7ccccf
|
|
| MD5 |
88a703feb6cd5eb2819aea9983713377
|
|
| BLAKE2b-256 |
4384480c8cc74f1da70e6d00774ff01b7fc7bfdee2efe7cdbf96306f1304a32c
|
File details
Details for the file mailbuddy-0.1.4-py3-none-any.whl.
File metadata
- Download URL: mailbuddy-0.1.4-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e01d4be51c63af3e245e2fcd149013f72a99eb2cc9186545cb441537ff1afc0b
|
|
| MD5 |
a2f7ca983fd85f9e9c1a35f097c75686
|
|
| BLAKE2b-256 |
7add382e7fd7978ac40aa441b17a2fc55db09a430bddae7f4aa36e398bc4ba31
|