Subversion Repositories SmartDukaan

Rev

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

Rev 873 Rev 884
Line 28... Line 28...
28
    if not mail:
28
    if not mail:
29
        raise HelperServiceException(101, "mail not present")
29
        raise HelperServiceException(101, "mail not present")
30
    #msg = MIMEMultipart()
30
    #msg = MIMEMultipart()
31
    #mail = Mail()
31
    #mail = Mail()
32
    msg = MIMEText(mail.data)
32
    msg = MIMEText(mail.data)
33
    msg['To'] = "help@saholic.com"
33
    msg['To'] = mail.to
34
    msg['From'] = "help@saholic.com"
34
    msg['From'] = "help@saholic.com"
35
    msg['Subject'] = mail.subject
35
    msg['Subject'] = (mail.subject).
36
    #msg.attach(mail.data)
36
    #msg.attach(mail.data)
37
    
37
    
38
    #handle attachments in mail
38
    #handle attachments in mail
39
    if mail.attachments:
39
    if mail.attachments:
40
        for attach in mail.attachments:
40
        for attach in mail.attachments:
Line 45... Line 45...
45
            part.add_header('Content-Disposition',
45
            part.add_header('Content-Disposition',
46
                    'attachment; filename="%s"' % os.path.basename(attach))
46
                    'attachment; filename="%s"' % os.path.basename(attach))
47
            msg.attach(part)
47
            msg.attach(part)
48
     
48
     
49
    for to in mail.to:
49
    for to in mail.to:
50
        #to
-
 
51
        msg['To'] = "help@saholic.com"
50
        msg['To'] = to
52
        mail.sender = "help@shop2020.in"
51
        mail.sender = "help@shop2020.in"
53
        mail.password = "5h0p2o2o"
52
        mail.password = "5h0p2o2o"
54
        mailServer = smtplib.SMTP("smtp.gmail.com", 587)
53
        mailServer = smtplib.SMTP("smtp.gmail.com", 587)
55
        mailServer.ehlo()
54
        mailServer.ehlo()
56
        mailServer.starttls()
55
        mailServer.starttls()