<commit_before>## FluentMail [![Build Status](https://travis-ci.org/alexandrevicenzi/fluentmail.svg)](https://travis-ci.org/alexandrevicenzi/fluentmail) [![PyPI](https://img.shields.io/pypi/v/fluentmail.svg)](https://pypi.python.org/pypi/fluentmail)

Python SMTP client and Email for Humans&#8482;

## Simple

FluentMail tries to keep it simple as possible.

### SMTP client

With FluentMail

```python
from fluentmail import SMTP, TLS

client = SMTP('smtp.gmail.com', user='user', password='password', security=TLS)
client.send(message)
```

Pure Python

```python
import smtplib

client = smtplib.SMTP('smtp.gmail.com', 587)
client.starttls()
client.login('user', 'password')
client.sendmail('<EMAIL>', '<EMAIL>', '<RAW EMAIL MESSAGE>')
```

### Email message

With FluentMail

```python
message = EMailMessage('FluentMail', 'Python SMTP client and Email for Humans', from_address='<EMAIL>', to='<EMAIL>')
message.attach_file('./photos/our-great-time-together.png')
```

Pure Python

```python
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import make_msgid, formatdate

message = MIMEMultipart()
message['Subject'] = 'FluentMail'
message['From'] = '<EMAIL>'
message['To'] = '<EMAIL>'
message['Date'] = formatdate()
message['Message-ID'] = make_msgid()
message.attach(MIMEText('Python SMTP client and Email for Humans', 'plain', 'utf-8'))

with open('./photos/our-great-time-together.png', 'rb') as f:
    message.attach(MIMEImage(f.read(), 'png'))
```

## Supported backends

- SMTP
- Mailgun (without attachment)
- Dummy (TODO)
- FileBased (TODO)
- MemoryBased (TODO)

## Install

`pip install fluentmail`

## Compatibility

Works with Python 2.6+, 3.3+ and PyPy.

## Documentation

TODO

## Future work

- Dummy backend
- FileBased backend
- MemoryBased backend
- Support template engines (Django, Jinja)
- Support Mailgun message attachment
- Support custom message headers
- Set default backend
- Thread-safety
- What more?<commit_msg>Update readme.<commit_after>## FluentMail [![Build Status](https://travis-ci.org/alexandrevicenzi/fluentmail.svg)](https://travis-ci.org/alexandrevicenzi/fluentmail) [![PyPI](https://img.shields.io/pypi/v/fluentmail.svg)](https://pypi.python.org/pypi/fluentmail)

Python SMTP client and Email for Humans&#8482;

## Simple

FluentMail tries to keep it simple as possible.

### SMTP client

With FluentMail

```python
from fluentmail import SMTP, TLS

client = SMTP('smtp.gmail.com', user='user', password='password', security=TLS)
client.send(message)
```

Pure Python

```python
import smtplib

client = smtplib.SMTP('smtp.gmail.com', 587)
client.starttls()
client.login('user', 'password')
client.sendmail('<EMAIL>', '<EMAIL>', '<RAW EMAIL MESSAGE>')
```

### Email message

With FluentMail

```python
from fluentmail import EMailMessage

message = EMailMessage('FluentMail', 'Python SMTP client and Email for Humans',
                       from_address='<EMAIL>', to='<EMAIL>')
message.attach_file('./photos/our-great-time-together.png')
```

Pure Python

```python
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import make_msgid, formatdate

message = MIMEMultipart()
message['Subject'] = 'FluentMail'
message['From'] = '<EMAIL>'
message['To'] = '<EMAIL>'
message['Date'] = formatdate()
message['Message-ID'] = make_msgid()
message.attach(MIMEText('Python SMTP client and Email for Humans', 'plain', 'utf-8'))

with open('./photos/our-great-time-together.png', 'rb') as f:
    message.attach(MIMEImage(f.read(), 'png'))
```

## Supported backends

- SMTP
- Mailgun (without attachment)

## Install

`pip install fluentmail`

## Compatibility

Works with Python 2.6+, 3.3+ and PyPy.

## Documentation

TODO

## Future work

- Dummy backend
- FileBased backend
- MemoryBased backend
- Support template engines (Django, Jinja)
- Support Mailgun message attachment
- Support custom message headers
- Set default backend
- Thread-safety
- What more?
{'fraction_non_alphanumeric': 0.15301618440411965, 'fraction_numerical': 0.005885237861696911, 'mean_word_length': 5.227480916030534, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2507584', 'n_tokens_mistral': 1436, 'n_tokens_neox': 1362, 'n_words': 340}