Subversion Repositories SmartDukaan

Rev

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

Rev 5631 Rev 5893
Line 37... Line 37...
37
    mailServer.sendmail(from_user, to, msg.as_string())
37
    mailServer.sendmail(from_user, to, msg.as_string())
38
    # Should be mailServer.quit(), but that crashes...
38
    # Should be mailServer.quit(), but that crashes...
39
    mailServer.close()
39
    mailServer.close()
40
 
40
 
41
    
41
    
42
def mail(from_user, from_pwd, to, subject, text, parts=[]):
42
def mail(from_user, from_pwd, to, subject, text, parts=[], cc=[], bcc=[]):
43
    msg = MIMEMultipart()
43
    msg = MIMEMultipart()
44
    
44
    
45
    msg['From'] = from_user
45
    msg['From'] = from_user
46
    msg['To'] = COMMASPACE.join(to)
46
    msg['To'] = COMMASPACE.join(to)
-
 
47
    if cc:
-
 
48
        to = to + cc
-
 
49
        msg['Cc'] = COMMASPACE.join(cc)
-
 
50
    if bcc:
-
 
51
        to = to + bcc
47
    msg['Subject'] = subject
52
    msg['Subject'] = subject
48
    
53
    
49
    msg.attach(MIMEText(text))
54
    msg.attach(MIMEText(text))
50
    
55
    
51
    for part in parts:
56
    for part in parts: