go-gomail / gomail

The best way to send emails in Go.
MIT License
4.29k stars 569 forks source link

how to config ssl #193

Open bingwill opened 4 months ago

bingwill commented 4 months ago

like the titile shows ,How can i enable ssl when sening emails.

wneessen commented 4 months ago

The package will automatically use SSL when port is set to 465. Check this: https://github.com/go-gomail/gomail/blob/81ebce5c23dfd25c6c67194b37d3dd3f338c98b1/smtp.go#L46C21-L46C24

Yet, this package is not maintained anymore, due to the maintainer sadly has passed away. You might want to consider using a different package like wneessen/go-mail which uses similar syntax like this package. SSL/TLS support is default there anyways and can be controlled via methods on the Client. See: https://pkg.go.dev/github.com/wneessen/go-mail#Client.SetSSL and https://pkg.go.dev/github.com/wneessen/go-mail#Client.SetTLSPolicy

bingwill commented 4 months ago

The package will automatically use SSL when port is set to 465. Check this: https://github.com/go-gomail/gomail/blob/81ebce5c23dfd25c6c67194b37d3dd3f338c98b1/smtp.go#L46C21-L46C24

Yet, this package is not maintained anymore, due to the maintainer sadly has passed away. You might want to consider using a different package like wneessen/go-mail which uses similar syntax like this package. SSL/TLS support is default there anyways and can be controlled via methods on the Client. See: https://pkg.go.dev/github.com/wneessen/go-mail#Client.SetSSL and https://pkg.go.dev/github.com/wneessen/go-mail#Client.SetTLSPolicy

what a pity. thanks,i will try.