A lightweight and fully functional SMTP server built using the emersion/go-smtp library in Golang.
This server accepts incoming emails, logs sender, recipients, and message body, and is suitable for testing, local development, or building custom email processing logic.
- π₯ Accepts and logs
MAIL FROM
,RCPT TO
, andDATA
- π§ Clean implementation using Go interfaces
- π‘ Listens on custom port (
:1025
) - π Supports optional plaintext authentication (for testing)
- π§ͺ Ideal for development/testing environments
- Language: Go (Golang)
- SMTP Library: github.com/emersion/go-smtp
Go_Mail/ βββ main.go # Main application with SMTP server implementation βββ go.mod # Module declaration βββ go.sum # Dependency hash tracking
-
Make sure you have Go installed:
https://go.dev/doc/install -
Clone the repository:
git clone https://github.com/yourusername/Go_Mail.git cd Go_Mail
3.Initialize Modul
go mod init go_mail go get github.com/emersion/go-smtp
4.Run the Server
go run main.go
By default, the server listens on: localhost:1025