Answer the question
In order to leave comments, you need to log in
How to know the output of a debug smtp server in Python?
The bottom line is this: there is a script that sends a letter through smtplib, which is configured for localhost and port 1025. The python debug server is running at the same address and port. The question is how to get the output of this server from the script? In words, it may not be clear, here are code snippets:
import subprocess
import shlex
command = 'python -m smtpd -n -c Debugging Server localhost:1025'
args = shlex.split(command)
p = subprocess.call(args, stdout=open('temp.txt', 'w'))
#здесь функция, которая отправляет почту через smplib.SMTP('localhost', 1025)
p.kill()
Answer the question
In order to leave comments, you need to log in
What a horror.
Why do you need a separate server to send one message?
Why didn't you want to connect to a real server?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question