mail

package
v0.0.0-...-ee15e7f Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIME_TYPE_TEXT = "text/plain"
	MIME_TYPE_HTML = "text/html"
	MIME_TYPE_JSON = "application/json"
	MIME_TYPE_PDF  = "application/pdf"

	MAX_DOWNLOAD_SIZE = 100000000
)

Variables

This section is empty.

Functions

func ServeMails

func ServeMails(mailConfig specs.MailConfig, db *sql.Db, wg *sync.WaitGroup, interval int)

Types

type Attachments

type Attachments struct {
	FileName string
	MimeTyoe string
}

type Client

type Client struct {
	Username   string
	Password   string
	From       string
	SmtpSecure bool
	ImapSecure bool
	SmtpServer string
	SmtpPort   uint16
	Pop3Server string
	Pop3Port   uint16
	Token      string
}

func NewMailClient

func NewMailClient(username string, password string, from string,
	smtpHost string, imapHost string, token string) *Client

func (*Client) GetBillingInformationsFromBody

func (c *Client) GetBillingInformationsFromBody(body string) (specs.AccountDetails, specs.BillingDetails, error)

func (*Client) GetMails

func (c *Client) GetMails() ([]Message, error)

func (*Client) SendEmail

func (c *Client) SendEmail(msg Message) error

type Message

type Message struct {
	To           []string
	CC           []string
	BCC          []string
	Subject      string
	Body         string
	BodyMimeType string
	Attachments  []Attachments
}

Jump to

Keyboard shortcuts

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