Documentation
¶
Index ¶
Constants ¶
View Source
const ( ErrorParamsEmpty errors.CodeError = iota + errors.MinPkgMail ErrorIORead ErrorIOWrite ErrorDateParsing ErrorSmtpClient ErrorSenderInit )
View Source
const ( RecipientTo recipientType = iota RecipientCC RecipientBCC )
View Source
const (
DateTimeLayout = time.RFC1123Z
)
Variables ¶
This section is empty.
Functions ¶
func IsCodeError ¶
func IsCodeError() bool
Types ¶
type Body ¶
type Body struct {
// contains filtered or unexported fields
}
contents represents the different content parts of an email body.
type ContentType ¶
type ContentType uint8
const ( // ContentPlainText sets body type to text/plain in message body. ContentPlainText ContentType = iota // ContentHTML sets body type to text/html in message body. ContentHTML )
func (ContentType) String ¶
func (c ContentType) String() string
type Email ¶
type Email interface { SetFrom(mail string) GetFrom() string SetSender(mail string) GetSender() string SetReplyTo(mail string) GetReplyTo() string SetReturnPath(mail string) GetReturnPath() string SetRecipients(rt recipientType, rcpt ...string) AddRecipients(rt recipientType, rcpt ...string) GetRecipients(rt recipientType) []string }
type Encoding ¶
type Encoding uint8
const ( // EncodingNone turns off encoding on the message body. EncodingNone Encoding = iota // EncodingBinary is equal to EncodingNone, but string is set to binary instead of none. EncodingBinary // EncodingBase64 sets the message body encoding to base64. EncodingBase64 // EncodingQuotedPrintable sets the message body encoding to quoted-printable. EncodingQuotedPrintable )
type File ¶
type File struct {
// contains filtered or unexported fields
}
file represents the files that can be added to the email message.
type Mail ¶
type Mail interface { SetCharset(charset string) GetCharset() string SetPriority(p Priority) GetPriority() Priority SetSubject(subject string) GetSubject() string SetEncoding(enc Encoding) GetEncoding() Encoding SetDateTime(datetime time.Time) GetDateTime() time.Time SetDateString(layout, datetime string) liberr.Error GetDateString() string AddHeader(key string, values ...string) GetHeader(key string) []string GetHeaders() textproto.MIMEHeader SetBody(ct ContentType, body io.ReadCloser) AddBody(ct ContentType, body io.ReadCloser) GetBody() []Body SetAttachment(name string, mime string, data io.ReadCloser, inline bool) AddAttachment(name string, mime string, data io.ReadCloser, inline bool) AttachFile(filepath string, data io.ReadCloser, inline bool) GetAttachment(inline bool) []File Email() Email Sender() (Sender, liberr.Error) }
Click to show internal directories.
Click to hide internal directories.