mail

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: MIT Imports: 3 Imported by: 0

README

mail

Install

go get github.com/zs5460/mail

Usage


cfg := mail.Config{
	MailSubject:   "test",
	MailServer:    "smtp.xxx.com:25",
	MailSender:    "xxx@xxx.com",
	MailSenderPwd: "******",
	MailReciver:   "abc@abc.com",
}

err := mail.SendMail(
	cfg.MailSender,
	cfg.MailSenderPwd,
	cfg.MailServer,
	cfg.MailReciver,
	cfg.MailSubject,
	"this is a test mail",
)
if err != nil {
	log.Println(err)
}

Licence

Released under MIT license, see LICENSE for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendMail

func SendMail(user, password, addr, to, subject, body string) error

SendMail ...

Types

type Config

type Config struct {
	MailSubject   string
	MailServer    string
	MailSender    string
	MailSenderPwd string
	MailReciver   string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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