Golang net/mail.ParseAddress() function example
package net/mail
Golang net/mail.ParseAddress() function usage example
package main
import (
"fmt"
"net/mail"
)
var emailAddresses = "Ms. Abc <abc@abc.com>, <def@def.com>, <ghi@ghi.com>"
func main() {
address, err := mail.ParseAddress(emailAddresses)
if err != nil {
panic(err)
}
fmt.Println(address.String())
}
Output :
"Ms. Abc" abc@abc.com
Reference :
Advertisement
Something interesting
Tutorials
+27.7k PHP : Count number of JSON items/objects
+10.1k Golang : Print how to use flag for your application example
+5.2k Golang : Convert lines of string into list for delete and insert operation
+10.3k Golang : Embed secret text string into binary(executable) file
+13.2k Golang : How to calculate the distance between two coordinates using Haversine formula
+17.6k Golang : delete and modify XML file content
+19.1k Golang : Display list of time zones with GMT
+5.2k PHP : See installed compiled-in-modules
+12.6k Golang : flag provided but not defined error
+3.4k Golang : Fix go-cron set time not working issue
+7.9k Javascript : How to check a browser's Do Not Track status?