Skip to content
/ mails Public

A library to simplify "net/smtp" sending mail

Notifications You must be signed in to change notification settings

gobkc/mails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About Mails

A library that simplifies sending mail using "net/smtp"

Contributing

You can commit PR to this repository

How to get it?

go get -u github.com/gobkc/mails

Quick start

package main

import (
	"github.com/gobkc/mails"
	"log"
)

func main() {
	mail := mails.Factory(&DefaultEmail{})
	if err := mail.SetEnv("example@163.com", "examplepassword", "smtp.163.com:25"); err != nil {
		log.Println(err.Error())
		return
	}
	if err := mail.SendOTPToMail("example_send_to_mail@qq.com", "test otp", ""); err != nil {
		log.Println(err.Error())
		return
	}
	if err := mail.SendToMail("example_send_to_mail@qq.com", "test title", "test content"); err != nil {
		log.Println(err.Error())
		return
	}
}

Note:The sender's SMTP function must be enabled

License

© Gobkc, 2022~time.Now

Released under the Apache License

About

A library to simplify "net/smtp" sending mail

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages