1
0
Эх сурвалжийг харах

docs: how the MIME are structured

Mikael Koli 3 жил өмнө
parent
commit
5789ce59b3

+ 69 - 1
docs/references.rst

@@ -20,4 +20,72 @@ Logging Classes
 
 .. autoclass:: redmail.EmailHandler
 
-.. autoclass:: redmail.MultiEmailHandler
+.. autoclass:: redmail.MultiEmailHandler
+
+
+.. _email_structure:
+
+Email Strucure (MIME)
+---------------------
+
+This section covers how Red Mail structures emails with MIME parts.
+You may need this information if you are creating unit tests or 
+if you face problems with rendering your emails by your email provider.
+
+Empty Email
+^^^^^^^^^^^
+
+Empty email has no MIME parts attached. It only has the headers.
+
+
+Email with a text body
+^^^^^^^^^^^^^^^^^^^^^^
+
+* text/plain
+
+
+Email with an HTML body
+^^^^^^^^^^^^^^^^^^^^^^^
+
+* multipart/mixed
+
+    * multipart/alternative
+
+        * text/html
+
+
+Email with an HTML body and inline JPG image
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+* multipart/mixed
+
+    * multipart/alternative
+
+        * multipart/related
+
+            * text/html
+            * image/jpg
+
+
+Email with an attachment
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+* multipart/mixed
+
+    * application/octet-stream
+
+
+Email with all elements
+^^^^^^^^^^^^^^^^^^^^^^^
+
+* multipart/mixed
+
+    * multipart/alternative
+
+        * text/plain
+        * multipart/related
+
+            * text/html
+            * image/jpg
+
+    * application/octet-stream

+ 4 - 1
docs/tutorials/testing.rst

@@ -12,7 +12,10 @@ with unit tests. There are several ways to do this.
 
     Red Mail extends :stdlib:`email.message.EmailMessage <email.message.html#email.message.EmailMessage>`
     from standard library. You may use its attributes and
-    methods for testing the contents of your messages.
+    methods for testing the contents of your messages. 
+    
+    See :ref:`email_structure` for how Red Mail's
+    emails are structured.
 
 Using get_message
 -----------------