Skip to content

Commit a7ff320

Browse files
committed
Contact Us
1 parent cdba0c7 commit a7ff320

5 files changed

Lines changed: 54 additions & 10 deletions

File tree

server/flaskserver.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import numpy as np
99
from matplotlib import pyplot as plt
1010
from pytesseract import image_to_string
11+
import smtplib, ssl
1112

1213
def ocr(filename):
1314
img = cv2.imread(f'static/images/cheques/{filename}')
@@ -153,6 +154,24 @@ def credits():
153154
def index():
154155
return render_template('index.html')
155156

157+
@app.route('/contactus',methods=['GET', 'POST'])
158+
def contactus():
159+
if request.method == 'POST':
160+
port = 465 # For SSL
161+
smtp_server = "smtp.gmail.com"
162+
sender_email = "[email protected]" # Enter your address
163+
receiver_email = request.form['email'] # Enter receiver address
164+
password = "vincere2020d2r"
165+
message = """\
166+
Chequify
167+
168+
Thanks for subscribing, """+request.form['name']+""", to our news letter! We appreciate your interest in our development.\n\n"""
169+
context = ssl.create_default_context()
170+
with smtplib.SMTP_SSL(smtp_server, port, context=context) as server:
171+
server.login(sender_email, password)
172+
server.sendmail(sender_email, receiver_email, message)
173+
return render_template('contactus.html')
174+
156175
@app.route('/',methods=['GET', 'POST'])
157176
def login():
158177
if request.method == 'POST':

server/static/data/950020.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
1+
950020
2+
Ten thousand rupees only
3+
10000
4+
2019-10-31
5+
695002032
6+
3
7+
Self
8+
00001234556001
9+
Yes
10+
Yes

server/static/images/.DS_Store

0 Bytes
Binary file not shown.

server/templates/contactus.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{% extends 'layout.html' %}
2+
{% block content %}
3+
<h1 class="header center orange-text">Subscribe</h1>
4+
<form class="center" method=post enctype=multipart/form-data>
5+
<div class="row" style="margin-top: 25px;" >
6+
<div class="col s3"></div>
7+
<div class="col s6">
8+
<div class='card'>
9+
<div class='card-content'>
10+
<fieldset style='border:none'>
11+
<h5 id="per_name" style="font-weight: bold;left:0;">Name</h5>
12+
<input name="name" placeholder="Name" type="text"/>
13+
<h5 id="per_name" style="font-weight: bold;left:0;">Email</h5>
14+
<input name="email" placeholder="Email" type="email"/>
15+
<input type="submit" class="btn-large waves-effect waves-light teal lighten-2"/>
16+
</fieldset>
17+
</div>
18+
</div>
19+
</div>
20+
</div>
21+
</form>
22+
{% endblock %}

server/templates/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ <h5 class="header col s12 light">Cheque recognition and text extraction using HT
1313
<br>
1414
<br>
1515
<a href="/credits" class="btn-large waves-effect waves-light green">Credits</a>
16+
<br>
17+
<br>
18+
<a href="/contactus" class="btn-large waves-effect waves-light teal">Subscribe To Our News Letter</a>
1619
</div>
1720
{% endblock %}

0 commit comments

Comments
 (0)