imap

package
v0.0.0-...-bb0ce8c Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a high level API for IMAP

func NewClient

func NewClient(host string, port int, useTls bool, mail string, password string) (*Client, error)

NewClient creates a new TCP connection and logs the user in

func (*Client) Close

func (c *Client) Close() error

Close connection and delete all messages marked as delete

func (*Client) DeleteMail

func (c *Client) DeleteMail(uid uint32) error

DeleteMail by uid, marks for deletion

func (*Client) GetMails

func (c *Client) GetMails(folder string) chan emailResult

GetMails for a given folder from the server

type EMail

type EMail struct {
	// Uid on the mail server
	Uid uint32
	// Subject of the mail
	Subject string
	// PlainText representation of the mail. This can be the original one or the stripped down HTML
	PlainText string
	// Html contains the original HTML representation of the mail
	Html string
	// From contains the sender address
	From []*imap.Address
	// Attachments contains a list of attached files
	Attachments map[string][]byte
}

EMail represents a parsed IMAP message

Jump to

Keyboard shortcuts

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