Documentation ¶
Overview ¶
Package email includes all functions required for sending emails using golang
Index ¶
Constants ¶
View Source
const (
// For sending HTML content (Passed as an argument to send function)
MIME_HTML = "MIME-version: 1.0;\nContent-Type: text/html; charset=\"UTF-8\";\n\n"
)
Mime type supported by email
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MailRequest ¶
type MailRequest struct {
// contains filtered or unexported fields
}
MailRequest represents struct to map email receiver(s), subject and body
func NewMailRequest ¶
func NewMailRequest(to []string, subject string, server string, port int, username string, password string, tpl *template.Template) *MailRequest
NewMailRequest returns pointer to MailRequest
func (*MailRequest) ParseTemplate ¶
func (r *MailRequest) ParseTemplate(fileName string, data interface{}) error
ParseTemplate binds the data passed with the email template file.
func (*MailRequest) Send ¶
func (r *MailRequest) Send(templateName string, mime string, items interface{}) (error, bool)
Send sends the email and saves the result in the log file
func (*MailRequest) SendMail ¶
func (r *MailRequest) SendMail(mime string) error
SendMail sends the email and returns true if email is sent successfully
Click to show internal directories.
Click to hide internal directories.