-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
41 lines (34 loc) · 1.12 KB
/
Copy pathapp.py
File metadata and controls
41 lines (34 loc) · 1.12 KB
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
34
35
36
37
38
39
40
41
# from js import document, localStorage, Object
from js import (
document,
console,
alert
)
from datetime import datetime
import smtplib
from email.mime.text import MIMEText
def convert_to_fahrenheit(celsius_value):
return round((celsius_value * 1.8000) + 32.00)
def get_current_time():
now = datetime.now()
return now.strftime("%m/%d/%Y, %H:%M")
def send_email(first, last, subject, message):
# Open a plain text file for reading. For this example, assume that
# the text file contains only ASCII characters.
# with open(textfile, 'rb') as fp:
# # Create a text/plain message
# msg = MIMEText(fp.read())
msg = MIMEText(message)
# me == the sender's email address
# you == the recipient's email address
me = 'no-reply@gmail.com'
you = 'eddie.hale@gmail.com'
msg['Subject'] = 'The contents of %s' % subject
msg['From'] = me
msg['To'] = you
# Send the message via our own SMTP server, but don't include the
# envelope header.
s = smtplib.SMTP('localhost', 25)
s.sendmail(me, [you], msg.as_string())
s.quit()
# send_email('Eddie', 'Hale', 'Test email from laptop', 'Hello world!!')