easyMail

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

README

easyMail

Super easy mail server written in go

Documentation

Index

Constants

View Source
const (
	GMAIL   = "gmail"
	YAHOO   = "yahoo"
	OUTLOOK = "outlook"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mail

type Mail struct {
	From    string
	To      []string
	Headers map[string]string
	Subject string
	Body    string
	IsHtml  bool
}

func NewMail

func NewMail(
	from string,
	to []string,
	subject string,
	body string,
	isHtml bool,
) *Mail

func (*Mail) AddHeader added in v0.1.1

func (m *Mail) AddHeader(key string, value string)

func (*Mail) ToRFC822 added in v0.1.1

func (m *Mail) ToRFC822() string

type MailSender

type MailSender struct {
	Email    string
	Password string
	Provider string
}

type MailServer

type MailServer struct {
	Sender MailSender
	Auth   smtp.Auth
}

func NewMailServer

func NewMailServer(email, password, provider string) *MailServer

func NewMailServerFromSender added in v0.1.1

func NewMailServerFromSender(sender MailSender) *MailServer

func (*MailServer) SendMail

func (s *MailServer) SendMail(mail *Mail) error

Jump to

Keyboard shortcuts

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