mailer

package
v0.0.0-...-f6ca644 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// QuotedPrintable represents the quoted-printable encoding as defined in
	// RFC 2045.
	QuotedPrintable gomail.Encoding = "quoted-printable"
	// Base64 represents the base64 encoding as defined in RFC 2045.
	Base64 gomail.Encoding = "base64"
	// Unencoded can be used to avoid encoding the body of an email. The headers
	// will still be encoded using quoted-printable encoding.
	Unencoded gomail.Encoding = "8bit"

	// DefaultCharset email
	DefaultCharset string = "iso-8859-1"
)

Variables

This section is empty.

Functions

func SendEmail

func SendEmail(resourceName string, to string, cc string, subject string, contentType string, content string, attachment ...string) error

SendEmail function

Types

type Attachment

type Attachment struct {
	Name string `json:"name,omitempty" bson:"name,omitempty"`
	Type string `json:"type,omitempty" bson:"type,omitempty"`
	Data string `json:"data,omitempty" bson:"data,omitempty"`
	Url  string `json:"url,omitempty" bson:"url,omitempty"`
	Path string `json:"path,omitempty" bson:"path,omitempty"`
}

Attachment struct

type Embed

type Embed struct {
	Name string `json:"name,omitempty" bson:"name,omitempty"`
	Type string `json:"type,omitempty" bson:"type,omitempty"`
	Data string `json:"data,omitempty" bson:"data,omitempty"`
	Url  string `json:"url,omitempty" bson:"url,omitempty"`
	Path string `json:"path,omitempty" bson:"path,omitempty"`
}

Embed struct

type MailConf

type MailConf struct {
	MailOption []MailOption `json:"mailResources" bson:"mailResources"`
}

MailConf struct

var (
	// Mail variable
	Mail MailConf
)

type MailOption

type MailOption struct {
	Name       string `json:"name" bson:"name"`
	Protocol   string `json:"protocol" bson:"protocol"`
	Host       string `json:"host" bson:"host"`
	Port       int    `json:"port" bson:"port"`
	SecureType string `json:"secureType" bson:"secureType"`
	Sender     string `json:"sender" bson:"sender"`
	SenderName string `json:"senderName" bson:"senderName"`
	Auth       bool   `json:"auth" bson:"auth"`
	UserName   string `json:"userName" bson:"userName"`
	Password   string `json:"password" bson:"password"`
}

MailOption struct

func GetMailResource

func GetMailResource(resourceName string) MailOption

GetMailResource function

type Mailer

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

Mailer struct

func EmailDial

func EmailDial(resourceName string) *Mailer

EmailDial function

func SetMailOption

func SetMailOption(mailOpt MailOption) *Mailer

SetMailOption function

func (*Mailer) GetMessageId

func (mailer *Mailer) GetMessageId() string

GetMessageId method

func (*Mailer) Send

func (mailer *Mailer) Send(to string, cc string, subject string, contentType string, content string, attachment ...string) error

Send method

func (*Mailer) SendWithAttachments

func (mailer *Mailer) SendWithAttachments(to string, cc string, subject string, contentType string, content string, attachments ...Attachment) error

SendWithAttachments method

func (*Mailer) SendWithAttachmentsEmbeds

func (mailer *Mailer) SendWithAttachmentsEmbeds(to string, cc string, subject string, contentType string, content string, attachments []Attachment, embeds []Embed) error

SendWithAttachments method

func (*Mailer) SetCharset

func (mailer *Mailer) SetCharset(charset string) *Mailer

func (*Mailer) SetEncoding

func (mailer *Mailer) SetEncoding(enc gomail.Encoding) *Mailer

Jump to

Keyboard shortcuts

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