Skip to main content

Python Mailing Library

Project description

MailPad Python Library

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.

Installation

You can install MailPad using pip:

pip install mailpad

Sending Email

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)

Sending Email With Attachments

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)

Brevo Integration

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)

Generating Emails With OpenAi

from mailpad import mailpadAI
import os
import openai

os.environ["OPENAI_API_KEY"]="YOUR_OPENAI_KEY"

mail = mailpadAI()
mail.openai()

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mailpad-1.0.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

mailpad-1.0.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file mailpad-1.0.2.tar.gz.

File metadata

  • Download URL: mailpad-1.0.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for mailpad-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2e19caebfc1812c4ef36b0742beae254fd5fc9ff9603da7b403f53e7b5683123
MD5 a8b2510466d7fd235aa3dc49fde964d0
BLAKE2b-256 454c816badd33fbce3a6bc3c6439be066570170b16d0e700a93f57f700135d19

See more details on using hashes here.

File details

Details for the file mailpad-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: mailpad-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for mailpad-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e874ff3295d786b57a3ada35c2beffc8479b9f350b920b7de12cc7eb675a6e9f
MD5 52e7e89bb563cf6e186d74793357105a
BLAKE2b-256 89f4fb6f91c01393ce21ff58767b43b2b12162a4dc20bc58472d7373030e9522

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page