go语言实现邮件发送
安装相关的包
go get github.com/jordan-wright/email
代码篇:
package main
import (
"fmt"
"github.com/jordan-wright/email"
"log"
"net/smtp"
"time"
)
func main() {
e := email.NewEmail()
//设置发送方的邮箱
e.From = "XXXXXXXXX@163.com"
// 设置接收方的邮箱
e.To = []string{"XXXXXXXX@qq.com"}
//设置抄送如果抄送多人逗号隔开
e.Cc = []string{"XXXXXXXX@qq.com","XXXXXXXX@qq.com"}
//设置秘密抄送
e.Bcc = []string{"XXXXXXXX@qq.com"}
// 设置主题
e.Subject = "爬虫运行报告"
t