Skip to content

tinybear1976/go-mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-langpacks

version: 0.9.1

一个简易纯文本邮件发送程序,可以发送附件。

A simple text mail sending program, you can send attachments.

Install

go get  github.com/tinybear1976/go-mail

Example

func TestSendMailOK(t *testing.T) {
	sender := MailSender{
		SenderMail:   "test@163.com",
		AuthPassword: "密码",
		SmtpServer:   "smtp.163.com:465",
	}
	body := MailBody{
		To:      "333@qq.com",
		Cc:      "",
		Subject: "test mail测试邮件",
		Text:    "2021年3月17日。go测试邮件",
		Attas: []MailAtta{{
			FileName: "20200309_bak.zip",
			FullPath: "/Users/wang/Downloads/20200309_bak.zip",
		}, {
			FileName: "RedisDesktopManager2020079.zip",
			FullPath: "/Users/wang/Downloads/RedisDesktopManager2020079.zip",
		}},
	}
	if err := SendMail(sender, body); err != nil {
		t.Error(err.Error())
	}
}

About

simple send mail for golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages