-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMailCheck.py
More file actions
33 lines (27 loc) · 1013 Bytes
/
Copy pathMailCheck.py
File metadata and controls
33 lines (27 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import smtplib as s
ob = s.SMTP("smtp.gmail.com", 587)
ob.starttls()
ob.login("aspire.doctor.appointment@gmail.com", "healthcareusingrasa0782#")
def email(name, number, email_id, age, gender, reason, time):
Name = name
Email = email_id
Mb_num = number
Age = age
Gender = gender
Reason = reason
Time = time
subject = "Appointment Confirmation Details"
body = "Name: {}\nNumber: {}\nAge: {}\nGender: {}\nReason: {}\nTime: {}\nYour appointment for tomorrow is confirmed".format(Name, Mb_num, Age, Gender, Reason, Time)
message = "Subject:{}\n\n{}".format(subject, body)
ob.sendmail("aspire.doctor.appointment@gmail.com", Email, message)
print("Sent successfully")
ob.quit()
return "success"
# Name = "Karan"
# Mb_num = 123
#
#
# subject = "Something"
# body = "Name: {}\nNumber: {}\nyour appointment is confirmed for so an so time".format(Name, Mb_num)
# message = "Subject:{}\n\n{}".format(subject, body)
# print(message)