smtp

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package smtp implements the Simple Mail Transfer Protocol as defined in RFC 5321. It extends net/smtp as follows:

  • Supports SMTPUTF8, via MailAndRcpt.
  • Adds IsPermanent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPermanent

func IsPermanent(err error) bool

IsPermanent returns true if the error is permanent, and false otherwise. If it can't tell, it returns false.

Types

type Client

type Client struct {
	*smtp.Client
}

A Client represents a client connection to an SMTP server.

func NewClient

func NewClient(conn net.Conn, host string) (*Client, error)

NewClient uses the given connection to create a new Client.

func (*Client) MailAndRcpt

func (c *Client) MailAndRcpt(from string, to string) error

MailAndRcpt issues MAIL FROM and RCPT TO commands, in sequence. It will check the addresses, decide if SMTPUTF8 is needed, and apply the necessary transformations.

Jump to

Keyboard shortcuts

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