Documentation ¶
Index ¶
- Constants
- func SendEmail(resourceName string, to string, cc string, subject string, contentType string, ...) error
- type Attachment
- type Embed
- type MailConf
- type MailOption
- type Mailer
- func (mailer *Mailer) GetMessageId() string
- func (mailer *Mailer) Send(to string, cc string, subject string, contentType string, content string, ...) error
- func (mailer *Mailer) SendWithAttachments(to string, cc string, subject string, contentType string, content string, ...) error
- func (mailer *Mailer) SendWithAttachmentsEmbeds(to string, cc string, subject string, contentType string, content string, ...) error
- func (mailer *Mailer) SetCharset(charset string) *Mailer
- func (mailer *Mailer) SetEncoding(enc gomail.Encoding) *Mailer
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 ¶
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 (*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) SetEncoding ¶
Click to show internal directories.
Click to hide internal directories.