# 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:
```python
pip install mailpad
```
## Sending Email
```python
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
```python
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/
```python
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
```python
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)
```
Raw data
{
"_id": null,
"home_page": "https://mailpad.tech/",
"name": "mailpad",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "mailpad,python,mail,email,email client,smtp",
"author": "Shivansh Dwivedi",
"author_email": "<me@shivanshdwivedi.tech>",
"download_url": "https://files.pythonhosted.org/packages/45/4c/816badd33fbce3a6bc3c6439be066570170b16d0e700a93f57f700135d19/mailpad-1.0.2.tar.gz",
"platform": null,
"description": "# MailPad Python Library\n\nMailPad 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.\n\n## Installation\n\nYou can install MailPad using pip:\n\n```python\npip install mailpad\n```\n## Sending Email\n\n```python\nfrom mailpad import mailpad\nimport os\n\nmail = mailpad('smtp-server','smtp-port')\n\nos.environ[\"MAILPAD_EMAIL\"] = \"YOUR_EMAIL\"\nos.environ[\"MAILPAD_PASSWORD\"] = \"YOUR_PASSWORD\"\n\nfrom_email = \"your_email@exphample.com\"\nto_email = [\"her_email@example.com\"]\nsubject = \"Subject\"\nmessage = \"\"\"Message Content\"\"\"\nmail.send_mail(from_email, to_email, subject, message)\n```\n\n## Sending Email With Attachments\n\n```python\nfrom mailpad import mailpad\nimport os\n\nmail = mailpad('smtp-server','smtp-port')\n\nos.environ[\"MAILPAD_EMAIL\"] = \"YOUR_EMAIL\"\nos.environ[\"MAILPAD_PASSWORD\"] = \"YOUR_PASSWORD\"\n\nfrom_email = \"your_email@exphample.com\"\nto_email = [\"her_email@example.com\"]\nsubject = \"Subject\"\nmessage = \"\"\"Message Content\"\"\"\nattachment = \"/Users/Docs/Letter.pdf\"\nmail.send_mail_with_attachmnet(from_email, to_email, subject, message,attachment)\n```\n\n## Brevo Integration\nCreate account at: https://www.brevo.com/\n\n```python\nfrom mailpad import mailpad\nimport os\n\n#Using Brevo Servers\nmail=mailpad()\nmail.brevo()\n\nos.environ[\"MAILPAD_EMAIL\"] = \"YOUR_EMAIL\"\nos.environ[\"MAILPAD_PASSWORD\"] = \"YOUR_PASSWORD\"\n\nfrom_email = \"your_email@exphample.com\"\nto_email = [\"her_email@example.com\"]\nsubject = \"Subject\"\nmessage = \"\"\"Message Content\"\"\"\nmail.send_mail(from_email, to_email, subject, message)\n```\n\n## Generating Emails With OpenAi\n\n```python\nfrom mailpad import mailpadAI\nimport os\nimport openai\n\nos.environ[\"OPENAI_API_KEY\"]=\"YOUR_OPENAI_KEY\"\n\nmail = mailpadAI()\nmail.openai()\n\nform_input = \"EMAIL_MESSAGE/EMAIL_CONTEXT\"\nemail_sender = \"SENDER_NAME\"\nemail_recipient = \"RECIPIENT_NAME\"\nemail_style = \"EMAIL_STYLE\"\n\nresponse = mail.get_llm_response(form_input, email_sender, email_recipient, email_style)\nprint(response)\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python Mailing Library",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://mailpad.tech/"
},
"split_keywords": [
"mailpad",
"python",
"mail",
"email",
"email client",
"smtp"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "89f4fb6f91c01393ce21ff58767b43b2b12162a4dc20bc58472d7373030e9522",
"md5": "52e7e89bb563cf6e186d74793357105a",
"sha256": "e874ff3295d786b57a3ada35c2beffc8479b9f350b920b7de12cc7eb675a6e9f"
},
"downloads": -1,
"filename": "mailpad-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "52e7e89bb563cf6e186d74793357105a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4302,
"upload_time": "2023-08-16T05:37:42",
"upload_time_iso_8601": "2023-08-16T05:37:42.859390Z",
"url": "https://files.pythonhosted.org/packages/89/f4/fb6f91c01393ce21ff58767b43b2b12162a4dc20bc58472d7373030e9522/mailpad-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "454c816badd33fbce3a6bc3c6439be066570170b16d0e700a93f57f700135d19",
"md5": "a8b2510466d7fd235aa3dc49fde964d0",
"sha256": "2e19caebfc1812c4ef36b0742beae254fd5fc9ff9603da7b403f53e7b5683123"
},
"downloads": -1,
"filename": "mailpad-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "a8b2510466d7fd235aa3dc49fde964d0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3763,
"upload_time": "2023-08-16T05:37:44",
"upload_time_iso_8601": "2023-08-16T05:37:44.422863Z",
"url": "https://files.pythonhosted.org/packages/45/4c/816badd33fbce3a6bc3c6439be066570170b16d0e700a93f57f700135d19/mailpad-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-16 05:37:44",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "mailpad"
}