Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 776 Bytes

README.md

File metadata and controls

42 lines (34 loc) · 776 Bytes

easyMail

Super easy mail server written in go

Installation

go get github.com/darkard2003/easyMail@latest

Usage

Using easyMail is very simple. You will need a email, and a application specific password. In gmail you can generate this password under security and then two factor authentication.

Importing

import "github.com/darkard2003/easyMail"

Creating a mail server

server := easyMail.NewMailServer("email", "password", easyMail.GMAIL)

Creating a mail

mail := easyMail.NewMail(
    "From",
    []string{"To1", "To2", "To3"},
    "Subject",
    "Body",
    false, // Is HTML
)

Attaching a file

err := mail.AddAttachment("path/to/file")

Sending a mail

err := server.SendMail(mail)