email

package
Version: v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

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

Source Files

Jump to

Keyboard shortcuts

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