Python Programming - Standard Libraries - Discussion

Discussion Forum : Standard Libraries - General Questions (Q.No. 74)
74.
What is the purpose of the email module?
Sorting elements in a list
Handling email messages and MIME attachments
Parsing JSON data
Working with cryptographic hash functions
Answer: Option
Explanation:
import email.message

# Example usage of email module for creating an email message
msg = email.message.EmailMessage()
msg.set_content("Hello, this is a test email.")
msg["Subject"] = "Test Email"
msg["From"] = "sender@example.com"
msg["To"] = "recipient@example.com"
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.