MailPad is a Python library that simplifies email sending and integrates with language models for generating email content. Utilizing OpenAI's language models to generate text emails.
MailPad can be installed using pip:
pip install mailpad
from mailpad import mailpad
import os
mail = mailpad('smtp-server','smtp-port')
os.environ["MAILPAD_EMAIL"] = "YOUR_EMAIL"
os.environ["MAILPAD_PASSWORD"] = "YOUR_PASSWORD"
from_email = "your_email@exphample.com"
to_email = ["her_email@example.com"]
subject = "Subject"
message = """Message Content"""
mail.send_mail(from_email, to_email, subject, message)
from mailpad import mailpad
import os
mail = mailpad('smtp-server','smtp-port')
os.environ["MAILPAD_EMAIL"] = "YOUR_EMAIL"
os.environ["MAILPAD_PASSWORD"] = "YOUR_PASSWORD"
from_email = "your_email@exphample.com"
to_email = ["her_email@example.com"]
subject = "Subject"
message = """Message Content"""
attachment = "/Users/Docs/Letter.pdf"
mail.send_mail_with_attachmnet(from_email, to_email, subject, message,attachment)
Create account at: https://www.brevo.com/
from mailpad import mailpad
import os
#Using Brevo Servers
mail=mailpad()
mail.brevo()
os.environ["MAILPAD_EMAIL"] = "YOUR_EMAIL"
os.environ["MAILPAD_PASSWORD"] = "YOUR_PASSWORD"
from_email = "your_email@exphample.com"
to_email = ["her_email@example.com"]
subject = "Subject"
message = """Message Content"""
mail.send_mail(from_email, to_email, subject, message)
from mailpad import mailpadAI
import os
import openai
os.environ["OPENAI_API_KEY"]="YOUR_OPENAI_KEY"
mail = mailpadAI()
mail.openai(temperature,model)
form_input = "EMAIL_MESSAGE/EMAIL_CONTEXT"
email_sender = "SENDER_NAME"
email_recipient = "RECIPIENT_NAME"
email_style = "EMAIL_STYLE"
response = mail.get_llm_response(form_input, email_sender, email_recipient, email_style)
print(response)
- Send plain text emails or emails with attachments
- Brevo Integration
- Supports OpenAI's language models
Contributions are welcome! If you have suggestions, bug reports, or would like to add new features, feel free to create issues or pull requests on the GitHub repository.
This project is licensed under the MIT License.