smtppreview

command module
v0.0.0-...-073647a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2023 License: BSD-3-Clause Imports: 22 Imported by: 0

README

SMTP Preview - SMTP Test tools

SMTP Preview is a tool for testing and inspecting email sending. It allows you to preview the layout and notification appearance of emails on different clients, as well as detecting potential SPAM warnings. It can be integrated into the development process for SMTP sending tests.

SMTP Preview is maintained by restsend.com.

Screenshot

Quick start

SMTP Preview is written in Golang, and running smtppreview requires the Golang development environment. If you do not have the Golang development environment, you can refer to the official documentation of golang.

  • Run smtppreivew via docker, the default smtp serve port is 9025
docker run -ti --rm -p 9025:9025 -p 8000:8000 restsend/smtppreview
  • Visit web console, http://localhost:8000

  • Send test mail via python code:

import smtplib
from email.mime.text import MIMEText
from email.header import Header

message = MIMEText('Hello SMTP Preview', 'plain', 'utf-8')
message['From'] = Header("unittest@restsend.com", 'utf-8')
message['To'] = Header("oss@restsend.com", 'utf-8')

subject = 'Hello SMTP Preview'
message['Subject'] = Header(subject, 'utf-8')

conn = smtplib.SMTP('localhost', port=9025)
# Mock login
conn.login('you@restsend.com', 'smtppreview')

r = conn.sendmail('you@restsend.com',
                  ['oss@restsend.com', 'hello@restsend.com'],
                  message.as_string())

print('send ok, result:', r)

How SMTP Preview work?

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL