email

package
v0.0.0-...-a36ef9d Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendEmail

func SendEmail(email *Email) error

Types

type Config

type Config struct {
	Username   string
	Password   string
	ImapServer string
	SmtpServer string
}

func NewConfig

func NewConfig(username, password, imapServer, smtpServer string) *Config

func NewConfigFromEnv

func NewConfigFromEnv() (*Config, error)

func (*Config) ConnectToServer

func (c *Config) ConnectToServer(service EmailService) (*client.Client, error)

type Email

type Email struct {
	ToAddress   []string
	FromAddress string
	Subject     string
	Body        string
}

func FetchEmails

func FetchEmails() ([]Email, error)

func NewEmail

func NewEmail(to []string, from, subject, body string) *Email

func (*Email) String

func (e *Email) String() string

type EmailService

type EmailService int
const (
	IMAP_SERVICE EmailService = 993
	SMTP_SERVICE EmailService = 587
)

Jump to

Keyboard shortcuts

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