Professional Documents
Culture Documents
What is the motivation of this application? How is this application
useful?
My this application informs a manager when a file is submitted by
department of business. As a manager supervises all the departments, it is
necessary that he aware of all the development. Due to his busy routine he
may miss some important update. In order to solve this issue, my this
application will help him/her when an important update is released in the
form of document. This application will help to inform the manager of any
business when a final development or a plan is approved by the head and its
ordinates of department e.g. finance, marketing etc.
B. What is the novelty of this work?
D. How does the program work? You should firstly provide a big
picture overview of what you’re trying to do. You should then
provide a detailed exposition of what specific steps you’ve taken.
You should include your code in the submitted assignment both as
part of the report, and also as an executable file (and supply the
source files )?
For my application I have made a web server in python. My basic idea is to
build an automated email messenger. For my I application I have assumed a
business portal that is owned by a specific business company. All the
proposals and business views are discussed here to bring all the employees
on a common platform. I have tried to implement a module of that idea and
prepared a submission page where I have classified the business employees
into their category like finance, marketing etc. .my idea was that as in the
business various phases are involved where the documentation for the
proposal or incremental work has to be submitted. So my html page has the
option to upload the file where all the workers are able to view it. After
submission the file will be submitted to server. Now the server script will
use SMTP method to send an email to the manager who supervises all the
departments. It will inform the manager that by particular employee of the
following department has uploaded the document. Moreover it will also
provide a quick link to view the file. All is done to give an ease to the
manager and remove an overhead as he has many responsibilities and may
not have time to visit the portal regularly.
CODE
For testing provide valid emails and password
import cgi
import smtplib
import urlparse
from socket import *
serverSocket.bind(('localhost',8699))
serverSocket.listen(1)
i=0
while True:
i=i+1
try:
message=connectionSocket.recv(1024)
print (message)
filename = message.split()[1]
outputdata = f.read()
print outputdata
url1 = filename
par = urlparse.parse_qs(urlparse.urlparse(url1).query)
print par
print par
print url1
connectionSocket.send('Content-Type: text/html\r\n')
connectionSocket.send(datalength)
connectionSocket.send('\n')
url1 = filename
par = urlparse.parse_qs(urlparse.urlparse(url1).query)
print par
connectionSocket.send(outputdata[i])
form = cgi.FieldStorage()
seachterm = form.getvalue('filename')
print seachterm
connectionSocket.close()
to = 'manger@gmail.com'
gmail_user = 'user@gmail.com'
gmail_user1 = 'user@gmail.com'
gmail_pwd = 'password'
msg= MIMEMultipart('alternative')
msg['Subject'] = "Link"
msg['From'] = gmail_user
msg['To'] = to
text = "Hi!\nThis is to inform you that a Plannner for this week has been added\nHere is
the link you wanted:\nhttp://localhost:8699/confirm.html"
msg.attach(part1)
smtpserver = smtplib.SMTP("smtp.gmail.com",587)
smtpserver.ehlo()
smtpserver.starttls()
smtpserver.ehlo
smtpserver.login(gmail_user, gmail_pwd)
print header
msg1 = header + '\n Notification for a planner \n\n' + message + msg.as_string()
print 'done!'
smtpserver.close()
print par
except IOError:
print 'IOERROR'
connectionSocket.send('\n')
connectionSocket.send(displayError)
connectionSocket.close()
print url1
serverSocket.close()
HTML Page
<!DOCTYPE html>
<html>
<body>
<table>
<option value="Finnance">Finnance</option>
<option value="HR">HR</option>
<option value="Events">Events</option>
<option value="Marketing">Marketing</option>
</select></td></tr><br>
</select>
</td></tr><br>
</table>
<input type="submit" value="Upload">
</form>
</body>
</html>