package main

import (
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
)
var tomail string
var api string

func sendErrMailApi(title,body string)  {
	jkmail, _ := sysconfig["jkmail"].(map[string]interface{})
	if jkmail != nil {
		tomail, _ = jkmail["to"].(string)
		api, _ = jkmail["api"].(string)
	}
	log.Println(tomail,api)
	res, err := http.Get(fmt.Sprintf("%s?to=%s&title=%s&body=%s", api, tomail, title, body))
	if err == nil {
		defer res.Body.Close()
		read, err := ioutil.ReadAll(res.Body)
		log.Println("邮件发送成功：", string(read), err)
	}else {
		log.Println("邮件发送失败：", err)
	}
}
