# README
发邮件
发送邮件,就是这么简单
使用
import (
"github.com/go-eyas/toolkit/email"
"github.com/BurntSushi/toml"
)
func ExampleSample() {
tomlConfig := `
host = "smtp.qq.com"
port = "465"
account = "[email protected]"
password = "haha, wo cai bu gao su ni ne"
name = "unit test"
secure = true
[tpl.a]
bcc = ["Jeason <[email protected]>"] # 抄送
cc = [] # 抄送人
subject = "Welcome, {{.Name}}" # 主题
text = "Hello, I am {{.Name}}" # 文本
html = "<h1>Hello, I am {{.Name}}</h1>" # html 内容
`
conf := &Config{}
toml.Decode(tomlConfig, conf)
email := New(conf)
email.SendByTpl("Yuesong Liu <[email protected]>", "a", struct{ Name string }{"Batman"})
}
# Functions
No description provided by the author