可支持多个收件人
This commit is contained in:
BIN
bin/mips64
BIN
bin/mips64
Binary file not shown.
BIN
bin/mips64le
BIN
bin/mips64le
Binary file not shown.
BIN
bin/mipsle
BIN
bin/mipsle
Binary file not shown.
BIN
bin/ppc64le
BIN
bin/ppc64le
Binary file not shown.
6
build.sh
6
build.sh
@@ -2,12 +2,12 @@
|
||||
|
||||
_build()
|
||||
{
|
||||
ARCH="386 amd64 arm arm64 mips mips64 mips64le mipsle ppc64 ppc64le"
|
||||
ARCH="amd64"
|
||||
|
||||
for a in $ARCH
|
||||
do
|
||||
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=$a go build -ldflags '-w -s' -o bin/$a && upx -9 bin/$a
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=$a go build -ldflags '-w -s' -o bin/$a src/main.go && upx -9 bin/$a
|
||||
done
|
||||
|
||||
}
|
||||
@@ -17,7 +17,7 @@ _install()
|
||||
ARCH=`go env | grep GOARCH | cut -d \" -f 2`
|
||||
cp bin/${ARCH} /bin/gomail
|
||||
chmod +x /bin/gomail
|
||||
cp gomail.ini /etc/
|
||||
cp -f etc/gomail.ini /etc/
|
||||
}
|
||||
|
||||
|
||||
|
||||
4
etc/gomail.ini
Normal file
4
etc/gomail.ini
Normal file
@@ -0,0 +1,4 @@
|
||||
[global]
|
||||
SEND_MAIL = "yuling.niu@hohong.cn"; // 发送者邮箱
|
||||
MAIL_KEY = "1234567"; // 发送者邮箱密钥
|
||||
SMTP_SERVER = "smtphz.qiye.163.com:994"; // smtp服务器地址
|
||||
@@ -1,4 +0,0 @@
|
||||
[global]
|
||||
SEND_MAIL = "yuling.niu@hohong.cn"; // 发送者QQ
|
||||
MAIL_KEY = "H6zf59UEWWpjnNN"; // 发送者QQ密钥
|
||||
SMTP_SERVER = "smtphz.qiye.163.com:994"; // smtp服务器地址
|
||||
@@ -57,10 +57,15 @@ func main() {
|
||||
|
||||
Text := flag.String("t", "", "文本")
|
||||
Subject := flag.String("s", "", "主题")
|
||||
is_Attac := flag.String("a", "", "是否添加附件")
|
||||
is_Attac := flag.String("a", "", "添加附件")
|
||||
To := flag.String("r", "", "接收者邮箱")
|
||||
flag.Parse()
|
||||
|
||||
// 依据空格分割字符串取得接收者
|
||||
strHaiCoder := *To
|
||||
TO := strings.Fields(strHaiCoder)
|
||||
fmt.Println("TO =", TO)
|
||||
|
||||
// 简单设置 log 参数
|
||||
log.SetFlags(log.Lshortfile | log.LstdFlags)
|
||||
|
||||
@@ -69,7 +74,7 @@ func main() {
|
||||
e.From = SEND_MAIL
|
||||
|
||||
// 设置 receiver 接收方 的邮箱 此处也可以填写自己的邮箱, 就是自己发邮件给自己
|
||||
e.To = []string{*To}
|
||||
e.To = TO
|
||||
|
||||
// 设置主题
|
||||
e.Subject = *Subject
|
||||
Reference in New Issue
Block a user