Closed jniltinho closed 8 years ago
Please explain what your problem is.
I guess you need to import crypto/tls in your tests. You should use goimports to automatically manage your imports.
No build :-(
package main
import (
"gopkg.in/gomail.v2"
)
func main() {
m := gomail.NewMessage()
m.SetHeader("From", "nilton@domain.com")
m.SetHeader("To", "nilton@domain2.com")
m.SetHeader("Subject", "Hello!")
m.SetBody("text/html", "Hello <b>Nilton OS</b>!")
// Send the email to Bob
d := gomail.NewPlainDialer("mail.domain.com", 587, "nilton@domain.com", "1234567")
d.TLSConfig = &tls.Config{InsecureSkipVerify: true}
if err := d.DialAndSend(m); err != nil {
panic(err)
}
}
:+1:
Add lib "crypto/tls"
OK,
Thank's
:-) Add plugin on SublimeText3 :-)
You're welcome.
Which editor do you use? I greatly recommend using goimports.
Maybe add this to FAQ,, for new-go-users = muppets like me.. trying to swim
import "crypto/tls"
undefined: tls in tls.Config
go build teste_email.go
command-line-arguments
./teste_email.go:16: undefined: tls in tls.Config