aboutsummaryrefslogtreecommitdiffstats
path: root/python/test_email.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/test_email.py')
-rw-r--r--python/test_email.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/python/test_email.py b/python/test_email.py
deleted file mode 100644
index 08509486..00000000
--- a/python/test_email.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# Import smtplib for the actual sending function
-import smtplib
-import pdb
-
-from email.mime.application import MIMEApplication
-from email.mime.multipart import MIMEMultipart
-from email.mime.text import MIMEText
-from string import Template
-
-names = ['Alistair', 'Edwin', 'Guillaume']
-emaillist = ["test_{0}@yopmail.com".format(name) for name in names]
-
-#SMTP server
-server = smtplib.SMTP('smtp.gmail.com:587')
-server.starttls()
-server.login("guillaume.horel@serenitascapital.com","Jdiema;06")
-
-s = Template("""Hello $name,
-
-Please find attached our investment letter.
-
-Best,
-David""")
-
-with open('/home/share/guillaume/Investment Letter/Q4/investment_letter.pdf', 'rb') as fh:
- pdf_attach = MIMEApplication(fh.read(), 'pdf')
-pdf_attach.add_header('Content-Disposition', 'attachment', filename = 'investment_letter.pdf')
-
-for i, name in enumerate(names):
- msg = MIMEMultipart()
- msg['Subject'] = 'Investment update'
- msg['From'] = 'guillaume.horel@serenitascapital.com'
- msg['To'] = emaillist[i]
- msg.attach(pdf_attach)
- msg.attach(MIMEText(s.substitute(name = name)))
- server.send_message(msg)
-server.quit()