Show More
@@ -36,11 +36,10 b' from email.utils import formatdate' | |||||
36 | from email import encoders |
|
36 | from email import encoders | |
37 |
|
37 | |||
38 |
|
38 | |||
39 |
|
||||
40 | class SmtpMailer(object): |
|
39 | class SmtpMailer(object): | |
41 | """SMTP mailer class |
|
40 | """SMTP mailer class | |
42 |
|
41 | |||
43 | mailer = SmtpMailer(mail_from, user, passwd, mail_server, |
|
42 | mailer = SmtpMailer(mail_from, user, passwd, mail_server, smtp_auth | |
44 | mail_port, ssl, tls) |
|
43 | mail_port, ssl, tls) | |
45 | mailer.send(recipients, subject, body, attachment_files) |
|
44 | mailer.send(recipients, subject, body, attachment_files) | |
46 |
|
45 | |||
@@ -50,7 +49,7 b' class SmtpMailer(object):' | |||||
50 |
|
49 | |||
51 | """ |
|
50 | """ | |
52 |
|
51 | |||
53 | def __init__(self, mail_from, user, passwd, mail_server,smtp_auth, |
|
52 | def __init__(self, mail_from, user, passwd, mail_server, smtp_auth=None, | |
54 |
|
|
53 | mail_port=None, ssl=False, tls=False, debug=False): | |
55 |
|
54 | |||
56 | self.mail_from = mail_from |
|
55 | self.mail_from = mail_from | |
@@ -163,3 +162,4 b' class SmtpMailer(object):' | |||||
163 | #just for safe seek to 0 |
|
162 | # just for safe seek to 0 | |
164 | msg_file.seek(0) |
|
163 | msg_file.seek(0) | |
165 | return msg_file.read() |
|
164 | return msg_file.read() | |
|
165 |
General Comments 0
You need to be logged in to leave comments.
Login now