Skip to content

Commit 5dc23f8

Browse files
author
Joshua Moore
committed
adding the main.py file which gives basic functionality for the email application. Also providing a list of the software being used so we can keep up with it
1 parent 23628be commit 5dc23f8

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

main.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#import needed libs
2+
from flask import Flask
3+
from flask_mail import Mail, Message
4+
5+
6+
7+
app=Flask(__name__)
8+
9+
app.config['MAIL_SERVER']='smtp.gmail.com'
10+
app.config['MAIL_PORT']=465
11+
app.config['MAIL_USERNAME']='yourid@gmail.com'
12+
app.config['MAIL_PASSWORD']= '*****'
13+
app.config['MAIL_USE_TLS']=False
14+
app.config['MAIL_USE_SSL'] = True
15+
mail=Mail(app)
16+
17+
18+
@app.route("/")
19+
def index():
20+
msg = Message(
21+
'Hello',
22+
sender ='youremail@gmail.com',
23+
recipients = ['recieversid@gmail.com']
24+
)
25+
26+
msg.body = 'Hello flask message sent from Flask-Mail'
27+
mail.send(msg)
28+
return 'Sent'
29+
30+
if __name__ == '__main__':
31+
app.run(debug=True)

softwareneeded.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pip install virtualenv
2+
pip install flask
3+
pip install Flask-Mail

0 commit comments

Comments
 (0)