send emails in unicode, fixes #31
This commit is contained in:
parent
90927247fd
commit
7473ed9450
2 changed files with 5 additions and 0 deletions
|
|
@ -51,6 +51,7 @@ func NewServer(cfg *Config) *Server {
|
|||
s.WriteTimeout = 10 * time.Second
|
||||
s.MaxMessageBytes = cfg.MaxSize * 1024 * 1024
|
||||
s.EnableREQUIRETLS = cfg.TLSRequired
|
||||
s.EnableSMTPUTF8 = true
|
||||
if log.GetLevel() == "DEBUG" || log.GetLevel() == "TRACE" {
|
||||
s.Debug = os.Stdout
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,6 +110,10 @@ func (e *Email) Compose(privkey string) string {
|
|||
var data strings.Builder
|
||||
|
||||
domain := strings.SplitN(e.From, "@", 2)[1]
|
||||
|
||||
data.WriteString("Content-Type: text/plain; charset=\"UTF-8\"")
|
||||
data.WriteString("\r\n")
|
||||
|
||||
data.WriteString("From: ")
|
||||
data.WriteString(e.From)
|
||||
data.WriteString("\r\n")
|
||||
|
|
|
|||
Loading…
Reference in a new issue