This pull request introduces two major enhancements to the existing email automation script:
Attachment Support: The script now allows users to attach files to emails, making it versatile for sending reports, documents, or images.
HTML Email Support: Users can now send rich-text emails using HTML formatting, adding more flexibility for formatting content, embedded links, and more.
Key Changes:
Added logic to handle file attachments.
Implemented an option to send HTML-formatted emails.
Included better error handling for failed email sending attempts.
Updated the send_email function to include parameters for attachments and HTML content.
New Parameters:
attachments (list): A list of file paths to be attached to the email.
email_body (str): Can now accept both plain text and HTML-formatted content.
Code Changes:
Added an option to attach files using msg.add_attachment().
Included a block to handle HTML emails using msg.add_alternative().
Updated the README.mdfile to reflect the changes made to the script.
Improved error handling for edge cases where sending the email might fail.
Benefits:
Versatility: Users can now send different types of content (plain text, HTML, and attachments), which expands the use cases of the script.
Customization: The script is easier to customize for professional purposes, where rich formatting and documents might be necessary.
Improved Usability: The added features make it simpler for users to manage their email automation tasks without having to alter the underlying Python code for different types of emails.
Testing:
Tested the email sending functionality with multiple recipients, both with and without attachments.
Verified that emails are sent correctly in HTML format, with fallback to plain text where necessary.
Checked that error handling works when invalid email addresses or server connection issues occur.
Documentation Updates:
Updated the README.md file with a detailed guide on how to use the new features.
README has been updated to reflect changes in the script and usage examples for both attachments and HTML-formatted emails.
Closing Notes:
This PR enhances the script by allowing more flexibility in the types of emails users can send. Please review the changes, and feel free to provide any feedback for improvements.
Description
Overview:
This pull request introduces two major enhancements to the existing email automation script:
Key Changes:
New Parameters:
Code Changes:
Added an option to attach files using
msg.add_attachment().
Included a block to handle HTML emails usingmsg.add_alternative()
. Updated theREADME.md
file to reflect the changes made to the script. Improved error handling for edge cases where sending the email might fail.Benefits:
Testing:
Documentation Updates:
Closing Notes:
NAME
ARADHYA CHAUDHARY ( @Stonebanks-js )
THANK YOU