func SendFromCache(filename string) {
	fmt.Println("email.SendFromCache: Sending from Cache")
	var body string
	line := make(chan string)
	file.Read(filename, line)
	for l := range line {
		body += l + "\n"
	}
	Send(body)
}
SendFromCache sends email via MailGun, smtp server, or simply a JSON file but loads body from cache file.
Filename is the location of the cache file
package email
import (
	"encoding/json"
	"fmt"
	"net/smtp"
	"os"
	"strconv"
	"github.com/gophergala2016/Pulse/LogPulse/config"
	"github.com/gophergala2016/Pulse/LogPulse/file"
	"github.com/mailgun/mailgun-go"
)
const (
	mailGunSend = iota
	smtpSend    = iota
	jsonSend    = iota
)
type JSONAlert struct {
	Message string `json:"message"`
	Body    string `json:"body"`
}
var (
	emailOption = -1
	ByPassMail = false
	mGun       *config.SecretConfig
	smtpConfig *config.SMTPConfig
	EmailList []string
	OutputFile   string
	stringBuffer []string
)
func init() {
	defer func() {
		if r := recover(); r != nil {
			fmt.Println(r)
			os.Exit(0)
		}
	}()
	if ByPassMail {
		emailOption = jsonSend
		return
	}
	val, err := config.Load()
	if err != nil {
		panic(fmt.Errorf("email.init: Failed to load Main config file"))
	}
	EmailList = val.EmailList
	OutputFile = val.OutputFile
	mGun, err = config.LoadSecret()
	if err != nil {
		smtpConfig, err = config.LoadSMTP()
		if err != nil {
			emailOption = jsonSend
			return
		}
		emailOption = smtpSend
		return
	}
	emailOption = mailGunSend
}