Standard library / net/smtp
smtp.ServerInfo
Describe the server name, TLS verification state and advertised mechanisms supplied to Auth. The struct alone does not establish a secure connection. Expected stdout: 'fixture.invalid true PLAIN\n'.
Formal Syntax & Structure
go syntaxgo
type ServerInfo struct { Name string TLS bool Auth []string}Working Example
Example Snippetgo
package main
import ( "fmt" "net/smtp")
func main() { s := smtp.ServerInfo{Name: "fixture.invalid", TLS: true, Auth: []string{"PLAIN"}} fmt.Println(s.Name, s.TLS, s.Auth[0])}
func must[T any](v T, e error) T { if e != nil { panic(e) } return v}func check(e error) { if e != nil { panic(e) }}