go get github.com/mailboxvalidator/mailboxvalidator-go/v2
package main
import (
"fmt"
"github.com/mailboxvalidator/mailboxvalidator-go/v2"
)
func main() {
mailboxvalidator.SetAPIKey("PASTE_YOUR_API_KEY_HERE")
result, err := mailboxvalidator.ValidateEmail("example@example.com")
if err != nil {
panic(err.Error())
}
if result.ErrorMessage != "" {
panic(result.ErrorMessage)
}
fmt.Printf("EmailAddress: %+v\n", result.EmailAddress)
fmt.Printf("Domain: %+v\n", result.Domain)
fmt.Printf("IsFree: %+v\n", result.IsFree)
fmt.Printf("IsSyntax: %+v\n", result.IsSyntax)
fmt.Printf("IsDomain: %+v\n", result.IsDomain)
fmt.Printf("IsSMTP: %+v\n", result.IsSMTP)
fmt.Printf("IsVerified: %+v\n", result.IsVerified)
fmt.Printf("IsServerDown: %+v\n", result.IsServerDown)
fmt.Printf("IsGreylisted: %+v\n", result.IsGreylisted)
fmt.Printf("IsDisposable: %+v\n", result.IsDisposable)
fmt.Printf("IsSuppressed: %+v\n", result.IsSuppressed)
fmt.Printf("IsRole: %+v\n", result.IsRole)
fmt.Printf("IsHighRisk: %+v\n", result.IsHighRisk)
fmt.Printf("IsCatchAll: %+v\n", result.IsCatchAll)
fmt.Printf("MailboxValidatorScore: %+v\n", result.MailboxValidatorScore)
fmt.Printf("TimeTaken: %+v\n", result.TimeTaken)
fmt.Printf("Status: %+v\n", result.Status)
fmt.Printf("CreditsAvailable: %+v\n", result.CreditsAvailable)
fmt.Printf("ErrorCode: %+v\n", result.ErrorCode)
fmt.Printf("ErrorMessage: %+v\n", result.ErrorMessage)
}
package main
import (
"fmt"
"github.com/mailboxvalidator/mailboxvalidator-go/v2"
)
func main() {
mailboxvalidator.SetAPIKey("PASTE_YOUR_API_KEY_HERE")
result, err := mailboxvalidator.DisposableEmail("example@example.com")
if err != nil {
panic(err.Error())
}
if result.ErrorMessage != "" {
panic(result.ErrorMessage)
}
fmt.Printf("EmailAddress: %+v\n", result.EmailAddress)
fmt.Printf("IsDisposable: %+v\n", result.IsDisposable)
fmt.Printf("CreditsAvailable: %+v\n", result.CreditsAvailable)
fmt.Printf("ErrorCode: %+v\n", result.ErrorCode)
fmt.Printf("ErrorMessage: %+v\n", result.ErrorMessage)
}
package main
import (
"fmt"
"github.com/mailboxvalidator/mailboxvalidator-go/v2"
)
func main() {
mailboxvalidator.SetAPIKey("PASTE_YOUR_API_KEY_HERE")
result, err := mailboxvalidator.FreeEmail("example@example.com")
if err != nil {
panic(err.Error())
}
if result.ErrorMessage != "" {
panic(result.ErrorMessage)
}
fmt.Printf("EmailAddress: %+v\n", result.EmailAddress)
fmt.Printf("IsFree: %+v\n", result.IsFree)
fmt.Printf("CreditsAvailable: %+v\n", result.CreditsAvailable)
fmt.Printf("ErrorCode: %+v\n", result.ErrorCode)
fmt.Printf("ErrorMessage: %+v\n", result.ErrorMessage)
}