![Mailshake logo](https://raw.github.com/jpsca/mailshake/master/docs/static/images/mailshake@2x.png)
# Mailshake
[![Build Status](https://travis-ci.org/jpsca/mailshake.svg?branch=master)](https://travis-ci.org/jpsca/mailshake)
Although Python makes sending email relatively easy via the smtplib
module, this library provides a couple of light wrappers over it.
These wrappers make sending email extra quick, easy to test email
sending during development, and provides support for platforms that
can't use SMTP.
Mailers availiable:
- SMTPMailer
- AmazonSESMailer
- ToConsoleMailer (prints the emails in the console)
- ToFileMailer (save the emails in a file)
- ToMemoryMailer (for testing)
- DummyMailer (does nothing)
Usage:
```python
from mailshake import SMTPMailer
mailer = SMTPMailer()
mailer.send(
subject='Hi',
text_content='Hello world!',
from_email='from@example.com',
to=['mary@example.com', 'bob@example.com']
)
```
You can also compose several messages and send them at the same time:
```python
from mailshake import SMTPMailer, EmailMessage
mailer = SMTPMailer()
messages = []
email_msg = EmailMessage(
"Weekend getaway",
"Here's a photo of us from our trip.",
"from@example.com",
"bob@example.com"
)
email_msg.attach_file("picture.jpg")
messages.append(email_msg)
#…
mailer.send_messages(*messages)
```
## Install for development
First, create an activate a virtualenv. eg:
```bash
python -m virtualenv .venv
source .venv/bin/activate
```
Then run `pip install -e .[dev]` or `make install`. This will install the library in editable mode and all its dependencies.
Raw data
{
"_id": null,
"home_page": "https://github.com/jpsca/mailshake",
"name": "mailshake",
"maintainer": "",
"docs_url": null,
"requires_python": "<4.0,>=3.6",
"maintainer_email": "",
"keywords": "",
"author": "Juan-Pablo Scaletti",
"author_email": "juanpablo@jpscaletti.com",
"download_url": "https://files.pythonhosted.org/packages/c6/fb/e67ddb075a95c090f9177d3eddde6990a34f290501403b113475b522f7e7/mailshake-2.3.tar.gz",
"platform": null,
"description": "![Mailshake logo](https://raw.github.com/jpsca/mailshake/master/docs/static/images/mailshake@2x.png)\n\n# Mailshake\n\n[![Build Status](https://travis-ci.org/jpsca/mailshake.svg?branch=master)](https://travis-ci.org/jpsca/mailshake)\n\nAlthough Python makes sending email relatively easy via the smtplib\nmodule, this library provides a couple of light wrappers over it.\n\nThese wrappers make sending email extra quick, easy to test email\nsending during development, and provides support for platforms that\ncan't use SMTP.\n\nMailers availiable:\n\n- SMTPMailer\n- AmazonSESMailer\n- ToConsoleMailer (prints the emails in the console)\n- ToFileMailer (save the emails in a file)\n- ToMemoryMailer (for testing)\n- DummyMailer (does nothing)\n\nUsage:\n\n```python\nfrom mailshake import SMTPMailer\n\nmailer = SMTPMailer()\nmailer.send(\n subject='Hi',\n text_content='Hello world!',\n from_email='from@example.com',\n to=['mary@example.com', 'bob@example.com']\n)\n```\n\nYou can also compose several messages and send them at the same time:\n\n```python\nfrom mailshake import SMTPMailer, EmailMessage\n\nmailer = SMTPMailer()\nmessages = []\n\nemail_msg = EmailMessage(\n \"Weekend getaway\",\n \"Here's a photo of us from our trip.\",\n \"from@example.com\",\n \"bob@example.com\"\n)\nemail_msg.attach_file(\"picture.jpg\")\nmessages.append(email_msg)\n\n#\u2026\n\nmailer.send_messages(*messages)\n```\n\n## Install for development\n\nFirst, create an activate a virtualenv. eg:\n\n```bash\npython -m virtualenv .venv\nsource .venv/bin/activate\n```\n\nThen run `pip install -e .[dev]` or `make install`. This will install the library in editable mode and all its dependencies.\n",
"bugtrack_url": null,
"license": "Apache License Version 2.0",
"summary": "Dramatically simplify sending email from your python app.",
"version": "2.3",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "05b15a9e321c666c0cbe49db2e28732771ce02a7c2f86c0824db5f43a80f8fd5",
"md5": "061dbfbc892186a480c4f1a1c55fc1c7",
"sha256": "e4e0b71abb5b61f105f5d5a966d7131790aeecf86d94bba7b92ff0b1ed2629e4"
},
"downloads": -1,
"filename": "mailshake-2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "061dbfbc892186a480c4f1a1c55fc1c7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.6",
"size": 17193,
"upload_time": "2023-04-24T16:47:28",
"upload_time_iso_8601": "2023-04-24T16:47:28.953741Z",
"url": "https://files.pythonhosted.org/packages/05/b1/5a9e321c666c0cbe49db2e28732771ce02a7c2f86c0824db5f43a80f8fd5/mailshake-2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c6fbe67ddb075a95c090f9177d3eddde6990a34f290501403b113475b522f7e7",
"md5": "3c679ab54091e15b148671cc95b3123a",
"sha256": "7fd4f2b49419a363374008c15b2ce2c3342a0d06d0d7c7cfb37dd989e62f0e4f"
},
"downloads": -1,
"filename": "mailshake-2.3.tar.gz",
"has_sig": false,
"md5_digest": "3c679ab54091e15b148671cc95b3123a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.6",
"size": 19093,
"upload_time": "2023-04-24T16:47:30",
"upload_time_iso_8601": "2023-04-24T16:47:30.951300Z",
"url": "https://files.pythonhosted.org/packages/c6/fb/e67ddb075a95c090f9177d3eddde6990a34f290501403b113475b522f7e7/mailshake-2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-24 16:47:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "jpsca",
"github_project": "mailshake",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "mailshake"
}