Commit 238b37a3 authored by vipul.v's avatar vipul.v

first

parent e1bc3832
......@@ -17,17 +17,13 @@ class SendEmail:
for file_read in files:
with open(file_read, "rb") as file:
print("sjsjhj")
file_data = file.read()
file_name = file.name
print(file_name)
# part['Content-Disposition'] = 'attachment; filename="%s"' % basename(f)
msg.add_attachment(file_data, maintype="application", subtype="xlsx", filename=file_name)
with smtplib.SMTP_SSL('smtp.gmail.com', 465, context=context) as smtp:
print("skfknk")
smtp.login(sender_email, sender_password)
smtp.sendmail(sender_email, receiver, msg.as_string())
# smtp.starttls()
except ValueError:
raise ValueError
except Exception as e:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment