mail/internal/mail/smtp.go
func (d *Dialer) DialAndSend(m ...*Message) error {
	s, err := d.Dial()
	if err != nil {
		return err
	}
	defer s.Close()

	return Send(s, m...)
}
func (d *Dialer) DialAndSend(m ...*Message) error {
	s, err := d.Dial()
	if err != nil {
		return err
	}
	defer s.Close()

	return Send(s, m...)
}
func ( d * Dialer ) DialAndSend ( m ... * Message ) error { s , err := d . Dial ( ) if err != nil { return err } defer s . Close ( ) return Send ( s , m ... ) }
// DialAndSend opens a connection to the SMTP server, sends the given emails and
// closes the connection.
DialAndSend opens a connection to the SMTP server sends the given emails and closes the connection .