From c276846a6589cb2843d3554a37d6518938e8e769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BD=A6=E4=B9=85=E9=BE=99?= Date: Sat, 18 Feb 2023 20:21:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=82=AE=E4=BB=B6=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E6=A1=88=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/main.go b/main.go index 5584a60..08a3487 100644 --- a/main.go +++ b/main.go @@ -453,8 +453,8 @@ func batchDataInsert(fileName string) { } dataBatchDuplicate = make([]BatchDataDuplicateLog, 0, batchSize) - } + continue } @@ -507,7 +507,7 @@ func batchDataInsert(fileName string) { dataBatchDuplicate = make([]BatchDataDuplicateLog, 0, batchSize) } subject := "丝芙兰数据包处理完成" - body := "数据包:" + fileName + ";\n总数:" + strconv.Itoa(count-bi) + ";\n过滤重复数:" + strconv.Itoa(bi) + ";\n过滤后总数:" + strconv.Itoa(count) + ";\n处理完成,请前往管理平台查看处理。" + body := "数据包:" + fileName + ";\n总数:" + strconv.Itoa(count+bi) + ";\n过滤重复数:" + strconv.Itoa(bi) + ";\n过滤后总数:" + strconv.Itoa(count) + ";\n处理完成,请前往管理平台查看处理。" err = SendEmail(subject, body) //发送邮件 if err != nil { applogger.Info("邮件发送失:%d", err) @@ -547,17 +547,13 @@ func SendEmail(subject string, body string) error { smtpPort := 465 from := "chejiulong@wemediacn.com" password := "hdQfpav4x8LwbJPH" - //from := "auto_system@wemediacn.com" - //password := "EJkp39HCajDhpWsx" - to := []string{"chejiulong@wemediacn.com", "99779212@qq.com", "wangyuanbing@wemediacn.com"} - + to := []string{"chejiulong@wemediacn.com", "wangyuanbing@wemediacn.com"} // 邮件内容 m := gomail.NewMessage() m.SetHeader("From", from) m.SetHeader("To", to...) m.SetHeader("Subject", subject) m.SetBody("text/plain", body) - // 邮件发送 d := gomail.NewDialer(smtpHost, smtpPort, from, password) d.TLSConfig = &tls.Config{InsecureSkipVerify: true} @@ -566,6 +562,5 @@ func SendEmail(subject string, body string) error { panic(err) //return } - return nil }