def upload_file():
    if request.method == 'POST':
        f = request.files['file']
        semail = request.form['semail']
        passw = request.form['passw']
        user = request.form['content']
        gree = request.form['greeting']
        subject = request.form['subject']
        f.save(secure_filename(f.filename))

        loc = (f.filename)
        wb = xlrd.open_workbook(loc)
        sheet = wb.sheet_by_index(0)
        sheet.cell_value(0, 0)
        namei = sheet.cell_value(1, 1)
        print(namei)
        print(gree)
        print(user)
        for i in range(0, 3):
            rmail = sheet.cell_value(i, 2)
            name = sheet.cell_value(i, 1)
            body = gree + " " + name + "," + "\n" + user
            mail(semail, passw, rmail, body, subject)
            print("mail send" + rmail)
        return 'file uploaded successfully %s' % f.filename
Exemple #2
0
def mymail():
    if request.method == 'POST':
        to_email = request.form['tosend']
        subject = request.form['subject']
        content = request.form['content']
        mail(to_email, subject, content)
        return render_template('success.html')
    return render_template('mailer.html')
Exemple #3
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import send

from_addr = '*****@*****.**'
to_addr = sys.argv[1]
subject = 'おてんき!会員登録 登録完了メール'
body = 'このメールアドレスで「おてんき!」の会員登録が完了しました。'
send.mail(from_addr, to_addr, subject, body)
    namei = sheet.cell_value(i, 1)

    name = namei.upper()
    namec = namei.title()
    #idno is a unique id which will be showed when the qr code is scanned
    rmail = sheet.cell_value(i, 2)  #rmail is the receiver's mail
    body = "Hi " + namec + "\n" + '''Greetings from Team Dhishna
We are more than happy to have you here for our workshop.Hope we played a vital role in improving your skills.
Attaching with this mail is your certificate which can be used in your CV or added to your Linkedin profile as a proof of your skill acquisition.
Wishing you all the very best and hoping to you soon on Dhishna.

Regards,
Dhishna 2020
    '''
    print(rmail)
    print(name)
    print(namei)
    print(namec)
    #image = qrfun(idno)         #calling function to generate qr code. Return the QR code image

    createpage(name)  #calling function to create pdf
    #createpage1(name)
    print("certificates gen " + name)
    #mail(rmail,body)
    #mail("*****@*****.**",body)
    print("before")
    mail(rmail, body)  #calling function to send mail
    print("mail send to " + name)
    #mail(rmail,body)
Exemple #5
0
from send import mail
from qr import qrfun

loc = ("details.xlsx")
wb = xlrd.open_workbook(loc)
sheet = wb.sheet_by_index(0)
sheet.cell_value(0, 0)
for i in range(1, 6):
    print(sheet.cell_value(i, 2))
    print(sheet.cell_value(i, 0))
    print(sheet.cell_value(i, 5))

    name = sheet.cell_value(i, 2)
    seat = sheet.cell_value(i, 0)
    food = sheet.cell_value(i, 5)
    cusat = sheet.cell_value(i, 4)
    idno = sheet.cell_value(
        i, 6
    )  #idno is a unique id which will be showed when the qr code is scanned
    #rmail=sheet.cell_value(i,1) #rmail is the receiver's mail
    body = "Hi " + name + " Wassup"
    print(body)

    image = qrfun(
        idno)  #calling function to generate qr code. Return the QR code image

    createpage(name, seat, food, cusat, image)  #calling function to create pdf
    #mail(rmail,body)
    #mail("*****@*****.**",body)
    mail("*****@*****.**", body)  #calling function to send mail