From bcae0c2d43b4155f5920efb3bd05ca80cc280812 Mon Sep 17 00:00:00 2001 From: Sam Sneed <163201376+sam-sneed@users.noreply.github.com> Date: Mon, 27 May 2024 18:05:08 +0000 Subject: [PATCH] Clean server code --- sneedmail.py => sneedmail-server.py | 20 -------------------- 1 file changed, 20 deletions(-) rename sneedmail.py => sneedmail-server.py (72%) diff --git a/sneedmail.py b/sneedmail-server.py similarity index 72% rename from sneedmail.py rename to sneedmail-server.py index fd0e6b7..5aff92f 100644 --- a/sneedmail.py +++ b/sneedmail-server.py @@ -50,18 +50,6 @@ class EmlServer(SMTPServer): print('%s saved.' % filename) self.no += 1 -def EmlClientSend(sender, to, subject, msg, passwd): - mail_client = smtplib.SMTP('localhost',1025) - mail_client.ehlo() - mail_client.login(sender, crypter(passwd)) - messg = MIMEMultipart() - messg['From'] = sender - messg['To'] = to - messg['Subject'] = subject - message = msg - messg.attach(crypter(MIMEText(message))) - mail_client.sendmail(sender, to, messg) - def run_server(): # start the smtp server on localhost:1025 email_server = EmlServer(('localhost', 1025), None) @@ -70,13 +58,5 @@ def run_server(): except KeyboardInterrupt: pass -def run_client(): - while True: - sender = input(": ") - password = crypter(input(": ")) - to = input(": ") - subject = input(": ") - msg = input(": ") - if __name__ == '__main__': run()