diff --git a/send.go b/send.go index 3e67265..af75ace 100644 --- a/send.go +++ b/send.go @@ -108,10 +108,9 @@ func addAddress(list []string, addr string) []string { } func parseAddress(field string) (string, error) { - a, err := mail.ParseAddress(field) - if a == nil { - return "", err + addr, err := mail.ParseAddress(field) + if err != nil { + return "", fmt.Errorf("gomail: invalid address %q: %v", field, err) } - - return a.Address, err + return addr.Address, nil }