Skip to content

Commit

Permalink
Merge pull request #193 from Anorak001/patch-3
Browse files Browse the repository at this point in the history
Create readme.md
  • Loading branch information
DhanushNehru authored Oct 22, 2023
2 parents befd10a + ff73928 commit 9b77b0f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Mail Sender/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Email Sender Script Documentation

This Python script sends an email with an attachment using the smtplib library. It is designed to send a sales report email with a specific body and a file attachment. Below are the details and usage of the script:

Email Content:

The email's body contains a simple message with a sales report for the year.
The sender's email address and password should be specified in the script.
The recipient's email address should also be provided in the script.


Code Explanation:

The script uses the smtplib library to send emails.
It constructs the email message with a subject, sender, recipient, and body text.
It attaches the 'temp.txt' file to the email.
It connects to the Gmail SMTP server, enables a secure connection, and logs in using the sender's credentials.
The email message is converted to a string, sent, and the connection to the SMTP server is closed.
A message, "Mail Sent," is printed to indicate that the email has been sent.

Please note that this script is set up for Gmail's SMTP server by default. If you are using a different email service, you may need to adjust the SMTP server details accordingly.

Ensure that you have allowed less secure apps to access your Gmail account or use an application-specific password for sending emails via Gmail

0 comments on commit 9b77b0f

Please sign in to comment.