From 475c11fbda997bd18543731547ca49eaaed9775f Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Tue, 9 Feb 2016 18:46:08 +0100 Subject: [PATCH] More fixes in sendmail --- paramecio/citoplasma/sendmail.py | 4 ++-- tests/sendmailtest.py | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/paramecio/citoplasma/sendmail.py b/paramecio/citoplasma/sendmail.py index e64e27e..8207f79 100644 --- a/paramecio/citoplasma/sendmail.py +++ b/paramecio/citoplasma/sendmail.py @@ -12,7 +12,7 @@ from email.mime.text import MIMEText class SendMail: - port=25 + port=587 host='localhost' @@ -50,7 +50,7 @@ class SendMail: except smtplib.SMTPException as e: - self.txt_error=e.__str__ + self.txt_error=e.__str__() return False diff --git a/tests/sendmailtest.py b/tests/sendmailtest.py index 7b3366d..0f87f5f 100644 --- a/tests/sendmailtest.py +++ b/tests/sendmailtest.py @@ -8,15 +8,10 @@ class TestFieldMethods(unittest.TestCase): 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 in html', 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 html and attachments', content_type='html', attachments=['tests/images/image.jpg']) ) - s.quit() \ No newline at end of file