:red:`Red` Mail =============== Red Mail is a Python library for sending emails. It makes sending emails a breeze regardless of if you need to include HTML, embed images or tables or attach documents. Sending emails is a pretty straight forward task. However, the standard SMTP libraries don't make it particularly easy especially if you want to include more than basic text. Red Mail aims to fix this and it makes sending emails a breeze regardless of if you need to include attachments, images or prettier HTML. Why Red Mail? ------------- Standard SMTP libraries are not very convenient to use. They let you modify any part of the message but simply sending emails **SHOULD NOT** look like this: .. code-block:: python import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText msg = MIMEMultipart('alternative') msg['Subject'] = f'The contents of {textfile}' msg['From'] = 'first.last@gmail.com' msg['To'] = 'first.last@example.com' part1 = MIMEText("Hello!", 'plain') part2 = MIMEText("
have you seen this?
{{ mytable }} """, body_tables={"mytable": pd.DataFrame({'a': [1,2,3], 'b': [1,2,3]})} ) You can also include images similarly: .. code-block: python from pathlib import Path import pandas as pd email.send( subject="Email subject", receivers=["me@gmail.com"], html="""have you seen this?
{{ myimg }} """, body_images={"myimg": "path/to/my/image.png"} ) Interested? ----------- There is much more to offer. Install the package: .. code-block:: console pip install redmail and read further. .. toctree:: :maxdepth: 2 :caption: Contents: tutorials/index references Indices and tables ================== * :ref:`genindex`