gomail

module
v0.0.0-...-081b7ad Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2019 License: MIT

README

GoMail v1.0.0

gomail is a very basic utility that allows to easilly send emails using go language.

How to use it

it is very simple. for this, first you need to create a connection to a smtp server

server := server.NewSMTPServerConnection("smtp.zoho.com", "465", "$YOUR_EMAIL_ADDRESS", "$YOUR_PASSWORD")
err := server.Connect()
if err != nil {
	panic(err)
}

then just create an email

mail := server.Mail{
SenderID: "danny@dsncode.com",
ToIds:    []string{"your_email@gmail.com"},
Subject:  "Email from GOMAIL",
Body:     "Hello world :)",
}

and send it

err = server.SendEmail(mail)
if err != nil {
	panic(err)
}

finally, do not forget to close your session

server.Close()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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