Set up a simple SMTP server in Python

I always forget it and google it, so make a note.

>>> import asyncore, smtpd
>>> smtpd.DebuggingServer(('localhost', 1025), None)
<smtpd.DebuggingServer listening localhost:1025 at 0x107a55d40>
>>> asyncore.loop()

Just launch the interactive shell and write as above. After that, when a message comes, it will be output on the spot.

Recommended Posts

Set up a simple SMTP server in Python
Set up a simple HTTPS server in Python 3
[Vagrant] Set up a simple API server with python
How to set up a simple SMTP server that can be tested locally in Python
Set up a simple HTTPS server with asyncio
Set up a UDP server in C language
Send mail with mailx to a dummy SMTP server set up with python.
Set up a local web server in 30 seconds using python 3's http.server
Set up a simple local server on your Mac
Set up a free server on AWS in 30 minutes
Implementing a simple algorithm in Python 2
Run a simple algorithm in Python
A simple HTTP client implemented in Python
Set up a Samba server with Docker
Try drawing a simple animation in Python
Set up a mail server using Twisted
Write a simple Vim Plugin in Python 3
Simple gRPC in Python
Set up a local server with Go-File upload-
Start a simple Python web server with Docker
A simple Pub / Sub program note in Python
Set up a local server with Go-File download-
Create a simple momentum investment model in Python
How to set up a local development server
Set up a Python development environment on Marvericks
DNS server in Python ....
Introduction and usage of Python bottle ・ Try to set up a simple web server with login function
Put Docker in Windows Home and run a simple web server with Python
Write a super simple molecular dynamics program in python
How to set up a Python environment using pyenv
Set up a Minecraft resource (Spigot) server via docker (2)
Set up a file server on Ubuntu 20.04 using Samba
Make a simple Slackbot with interactive button in python
[Part 1] Let's set up a Minecraft server on Linux
Set up a Minecraft resource (Spigot) server via docker
Create a fake Minecraft server in Python with Quarry
Setting up Jupyter Lab in a Python 3.9 venv environment
Set up a Python development environment with Sublime Text 2
Set a proxy for Python pip (described in pip.ini)
Set up Python 3.4 on Ubuntu
Take a screenshot in Python
Create a function in Python
Create a dictionary in Python
Create a (simple) REST server
Set Up for Mac (Python)
Make a bookmarklet in Python
Simple regression analysis in Python
Simple HTTP Server for python
Create a simple textlint server
Draw a heart in Python
Simple IRC client in python
Set up Nunjucks in Node.js
Set python test in jenkins
Hello World is a simple web server that follows WSGI (Web Server Gateway Interface) in Python.
Set up an FTP server that can be created and destroyed immediately (in Python)
I made a simple typing game with tkinter in Python
Set up a Python development environment with Visual Studio Code
How to import Python library set up in EFS to Lambda
Set up a web server with CentOS7 + Anaconda + Django + Apache
How to specify a public directory Python simple HTTP server
A simple way to avoid multiple for loops in Python