Giter Site home page Giter Site logo

shvuuuu / mailpad Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 2.0 48 KB

MailPad is a Python library that simplifies email sending and integrates with OpenAi's language models for generating email content.

Home Page: https://mailpad.tech/

License: MIT License

Python 100.00%
email-generator email-integration email-sender openai openai-api python langchain

mailpad's Introduction

Mailpad Tech

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

MailPad can be installed 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 = "[email protected]"
to_email = ["[email protected]"]
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 = "[email protected]"
to_email = ["[email protected]"]
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 = "[email protected]"
to_email = ["[email protected]"]
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(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)

Features

  • Send plain text emails or emails with attachments
  • Brevo Integration
  • Supports OpenAI's language models

Contributing

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.

License

This project is licensed under the MIT License.

mailpad's People

Contributors

shvuuuu avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.