def welcome_user(): username = session['username'] password = session['password'] form = sendMailForm() if form.validate_on_submit(): f = form.att.data if f is not None: f.save(f.filename) sendMail(username, password, form.to.data, form.subject.data, form.body.data, form.att.data.filename) os.remove(form.att.data.filename) print("in") sendMail(username, password, form.to.data, form.subject.data, form.body.data) form.to.data = '' form.subject.data = '' form.body.data = '' data = getMail(username, password) title = "inbox" return render_template('userpage.html', form=form, sender=data[0], body=data[1], title=title)
def showtrash(): username = session['username'] password = session['password'] form = sendMailForm() data = getTrash(username, password) if form.validate_on_submit(): sendMail(username, password, form.to.data, form.subject.data, form.body.data) form.to.data = '' form.subject.data = '' form.body.data = '' title = "trash" return render_template('userpage.html', form=form, sender=data[0], body=data[1], title=title)
def welcome_user(): username = session['username'] password = session['password'] form = sendMailForm() if form.validate_on_submit(): f = form.att.data f.save(f.filename) sendMail(username, password, form.to.data, form.subject.data, form.body.data, form.att.data.filename) form.to.data = '' form.subject.data = '' form.body.data = '' os.remove(form.att.data.filename) data = getMail(username, password) title = "inbox" #bodyCheck = toMarkup(data[1]) return render_template('userpage.html', form=form, sender=data[0], body=data[1], title=title)