Subversion Repositories SmartDukaan

Rev

Rev 6972 | Rev 7038 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6972 Rev 6979
Line 73... Line 73...
73
    msg = ''.join(MESSAGE)
73
    msg = ''.join(MESSAGE)
74
    smtpServer = smtplib.SMTP('localhost')
74
    smtpServer = smtplib.SMTP('localhost')
75
    smtpServer.set_debuglevel(1)
75
    smtpServer.set_debuglevel(1)
76
    msg = MIMEText(msg)
76
    msg = MIMEText(msg)
77
    sender = 'inventory-monitor@shop2020.in'
77
    sender = 'inventory-monitor@shop2020.in'
78
    recipients = ['eng@shop2020.in', 'rajneesh.arora@shop2020.in']
78
    recipients = ['rajneesh.arora@shop2020.in','rajveer.singh@shop2020.in','kshitij.sood@shop2020.in',
-
 
79
                  'vikram.raghav@shop2020.in','amar.kumar@shop2020.in','amit.gupta@shop2020.in',
-
 
80
                  'anupam.singh@shop2020.in']
79
    msg['Subject'] = "Warehouse Inventory Monitor"
81
    msg['Subject'] = "Warehouse Inventory Monitor"
80
    msg['From'] = sender
82
    msg['From'] = sender
81
    msg['To'] = ", ".join(recipients)
83
    msg['To'] = ", ".join(recipients)
82
    
84
    
83
    try:
85
    try:
84
        smtpServer.sendmail(sender, recipients, msg.as_string())
86
        smtpServer.sendmail(sender, recipients, msg.as_string())
85
        print "Successfully sent email"
87
        print "Successfully sent email"
86
    
88
    
87
    except:
89
    except:
88
        print "Error: unable to send email"
90
        print "Error: unable to send email"
89
    
-
 
90
 
91
 
91
def main():
92
def main():
92
    try:
93
    try:
93
        sql = '''select * from warehouseMonitor'''
94
        sql = '''select * from warehouseMonitor'''
94
        cursor.execute(sql)
95
        cursor.execute(sql)