Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9773eb5

Browse files
Added by vinay
This script sends congratulation emails to the selected candidates with thier names after each round of interview process.
1 parent 4d6dad5 commit 9773eb5

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
from email.mime.text import MIMEText
2+
from email.mime.multipart import MIMEMultipart
3+
import xlrd
4+
import time
5+
import smtplib
6+
7+
path = "selects.xlsx"
8+
File = xlrd.open_workbook(path)
9+
sheet = File.sheet_by_name('Selects')
10+
11+
12+
mail_list = []
13+
interviewerlist = []
14+
name = []
15+
for k in range(sheet.nrows-1):
16+
student = sheet.cell_value(k+1,0)
17+
email = sheet.cell_value(k+1,1)
18+
passed = sheet.cell_value(k+1,3)
19+
interviewer = sheet.cell_value(k+1,4)
20+
if passed == 'Yes':
21+
mail_list.append(email)
22+
interviewerlist.append(interviewer)
23+
name.append(student)
24+
25+
26+
email = 'example@gmail.com' # add the sender's email address
27+
password = '*****' # sender's password
28+
server = smtplib.SMTP('smtp.gmail.com', 587)
29+
server.starttls()
30+
server.login(email, password)
31+
32+
for mail_to in mail_list:
33+
send_to_email = mail_to
34+
find_des = mail_list.index(send_to_email)
35+
studentName = name[find_des]
36+
subject = f'Congratulations {studentName}!! You are selected for further interviews.'
37+
message = f'Dear {studentName}, \n' \
38+
f'We inform you that you wil be interviewed by ${interviewerlist[find_des]}. Please wait for the concern mail from your interviewer. \n'\
39+
'\n' \
40+
'Best Regards'
41+
42+
msg = MIMEMultipart()
43+
msg['From '] = send_to_email
44+
msg['Subject'] = subject
45+
msg.attach(MIMEText(message, 'plain'))
46+
text = msg.as_string()
47+
print(f'Sending email to {studentName}... ')
48+
server.sendmail(email, send_to_email, text)
49+
50+
server.quit()
51+
print('Mails sent!')
52+
time.sleep(10)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /