camper/pkg/mail/encoding.go

62 lines
1.4 KiB
Go

// SPDX-FileCopyrightText: 2022-2023 The go-mail Authors
//
// SPDX-License-Identifier: MIT
package mail
// Charset represents a character set for the encoding
type Charset string
// ContentType represents a content type for the Msg
type ContentType string
// Encoding represents a MIME encoding scheme like quoted-printable or Base64.
type Encoding string
// MIMEVersion represents the MIME version for the mail
type MIMEVersion string
// MIMEType represents the MIME type for the mail
type MIMEType string
// List of supported encodings
const (
// EncodingB64 represents the Base64 encoding as specified in RFC 2045.
EncodingB64 Encoding = "base64"
// EncodingQP represents the "quoted-printable" encoding as specified in RFC 2045.
EncodingQP Encoding = "quoted-printable"
// NoEncoding avoids any character encoding (except of the mail headers)
NoEncoding Encoding = "8bit"
)
const (
// CharsetUTF8 represents the "UTF-8" charset
CharsetUTF8 Charset = "UTF-8"
)
const (
// Mime10 is the MIME Version 1.0
Mime10 MIMEVersion = "1.0"
)
const (
TypeTextPlain ContentType = "text/plain"
TypeTextHTML ContentType = "text/html"
)
const (
MIMEAlternative MIMEType = "alternative"
)
// String is a standard method to convert an Encoding into a printable format
func (e Encoding) String() string {
return string(e)
}
// String is a standard method to convert a Charset into a printable format
func (c Charset) String() string {
return string(c)
}