Sample code for 30+ languages & platforms
Chilkat2-Python

Load MIME Object from Email Object

See more Email Object Examples

Demonstrates how to load a Chilkat Mime object from a Chilkat Email object. (Copies the email into a Mime object.)

Chilkat Chilkat2-Python Downloads

Chilkat2-Python
import chilkat2

success = False

email = chilkat2.Email()
success = email.LoadEml("qa_data/eml/sample.eml")

# Write the full MIME of the email to a StringBuilder.
sbMime = chilkat2.StringBuilder()
email.GetMimeSb(sbMime)

# Load the MIME object from the StringBuilder
mime = chilkat2.Mime()
success = mime.LoadMimeSb(sbMime)

print(mime.GetMime())