-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decided that experiment was not going to work, so switching back to u…
…sing a remote SMTP server
- Loading branch information
Murray Christopherson
committed
Apr 14, 2018
1 parent
41f735c
commit bd18fca
Showing
7 changed files
with
14 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SMTP_HOST = os.environ[u'SMTP_HOST'] | ||
SMTP_PORT = int(os.environ.get(u'SMTP_PORT', u'25')) | ||
SMTP_USERNAME = os.environ[u'SMTP_USERNAME'] | ||
SMTP_PASSWORD = os.environ[u'SMTP_PASSWORD'] |
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
import unittest | ||
|
||
from quick_email import send_email | ||
import tests.smtp.smtpd_fake as smtp | ||
import tests.smtp as smtp | ||
|
||
class TestQuickEmail(unittest.TestCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
smtp.smtp_server_start() | ||
|
||
def test_send_email(self): | ||
send_email(u'localhost', smtp.SMTP_PORT, u'Example <example@example.com>', u'The Subject', send_to=u'Test <test@test.com>', plain_text=u'Some Text', html_text=u'<b>Some Bold Text</b>') | ||
|
||
def test_send_email_starttls(self): | ||
send_email(u'localhost', smtp.SMTP_PORT, u'Example <example@example.com>', u'The Subject', send_to=u'Test <test@test.com>', plain_text=u'Some Text', html_text=u'<b>Some Bold Text</b>', require_starttls=True) | ||
class TestQuickEmail(unittest.TestCase): | ||
def test_send_email_auth(self): | ||
send_email(smtp.SMTP_HOST, smtp.SMTP_PORT, u'Example <example@example.com>', u'The Subject', send_to=u'Test <test@test.com>', plain_text=u'Some Text', html_text=u'<b>Some Bold Text</b>', username=smtp.SMTP_USERNAME, password=smtp.SMTP_PASSWORD) | ||
|
||
def test_send_email_starttls_auth(self): | ||
send_email(u'localhost', smtp.SMTP_PORT, u'Example <example@example.com>', u'The Subject', send_to=u'Test <test@test.com>', plain_text=u'Some Text', html_text=u'<b>Some Bold Text</b>', username=u'testuser', password=u'password', require_starttls=True) | ||
send_email(smtp.SMTP_HOST, smtp.SMTP_PORT, u'Example <example@example.com>', u'The Subject', send_to=u'Test <test@test.com>', plain_text=u'Some Text', html_text=u'<b>Some Bold Text</b>', username=smtp.SMTP_USERNAME, password=smtp.SMTP_PASSWORD, require_starttls=True) | ||
|
||
if __name__ == u'__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters