goemail

package module
v0.0.0-...-cfda803 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: AGPL-3.0 Imports: 2 Imported by: 0

README

SENDING EMAIL - GoEmail

Install librery
go get github.com/Leonardo-Antonio/goemail
Use

Configuración y envío del mensaje (html template)

func main () {
    mail := goemail.New(
	&goemail.Config{
		UserName: "leo2001.nl08@gmail.com",
		Password: "password", // se recomienda crear una contraseña de aplicación
		Host:     "smtp.gmail.com", // example -> smtp.gmail.com
		Port:     "587", // port the host smtp 
	},)

    mail.Send(goemail.Email{
	From:    "master@example.com",
	To:      []string{"mail2@example.com", "mail1@example.com"},
	Subject: "Subject test",
	Mime:    goemail.HTML,
	Body:    "<h1>Hola Mundo</h1>",
}

Documentation

Index

Constants

View Source
const HTML = "MIME-version: 1.0;\nContent-Type: text/html; charset=\"UTF-8\";\n\n"

Variables

This section is empty.

Functions

func New

func New(config *Config) *goEmail

Types

type Config

type Config struct {
	UserName string
	Password string
	Host     string
	Port     string
}

type Email

type Email struct {
	From    string
	To      []string
	Subject string
	Mime    string
	Body    string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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