More fixes in sendmail
This commit is contained in:
parent
adaaa98140
commit
475c11fbda
2 changed files with 2 additions and 7 deletions
|
|
@ -12,7 +12,7 @@ from email.mime.text import MIMEText
|
||||||
|
|
||||||
class SendMail:
|
class SendMail:
|
||||||
|
|
||||||
port=25
|
port=587
|
||||||
|
|
||||||
host='localhost'
|
host='localhost'
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@ class SendMail:
|
||||||
|
|
||||||
except smtplib.SMTPException as e:
|
except smtplib.SMTPException as e:
|
||||||
|
|
||||||
self.txt_error=e.__str__
|
self.txt_error=e.__str__()
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,10 @@ class TestFieldMethods(unittest.TestCase):
|
||||||
|
|
||||||
s=sendmail.SendMail()
|
s=sendmail.SendMail()
|
||||||
|
|
||||||
print(s.txt_error)
|
|
||||||
|
|
||||||
#self.assertEqual(phrase, 'this---is-a-crap-phrase-o---f-oh-yeah--')
|
|
||||||
|
|
||||||
self.assertTrue( s.send(config.portal_email, config.email_test, 'This is a test', 'A message for test a simple email method', content_type='plain', attachments=[]) )
|
self.assertTrue( s.send(config.portal_email, config.email_test, 'This is a test', 'A message for test a simple email method', content_type='plain', attachments=[]) )
|
||||||
|
|
||||||
self.assertTrue( s.send(config.portal_email, config.email_test, 'This is a test', 'A message for test a simple email method in <b>html</b>', content_type='html', attachments=[]) )
|
self.assertTrue( s.send(config.portal_email, config.email_test, 'This is a test', 'A message for test a simple email method in <b>html</b>', content_type='html', attachments=[]) )
|
||||||
|
|
||||||
self.assertTrue( s.send(config.portal_email, config.email_test, 'This is a test', 'A message for test a simple email method in <b>html</b> and attachments', content_type='html', attachments=['tests/images/image.jpg']) )
|
self.assertTrue( s.send(config.portal_email, config.email_test, 'This is a test', 'A message for test a simple email method in <b>html</b> and attachments', content_type='html', attachments=['tests/images/image.jpg']) )
|
||||||
|
|
||||||
|
|
||||||
s.quit()
|
s.quit()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue