func ManuallyVerifyEmailSend(provider mtacontainer.MTAProvider, to string) { // // Output all events from MTA Provider // c := make(chan int) go func() { for { select { case <-c: return case e := <-provider.GetEvent(): println(e.GetError().Error()) } } }() // Send verification email mail := model.NewMailSimpleHeaders("Test\nTest\nTest", map[string]string{ "To": to, "From": "*****@*****.**", "Subject": "Test email"}) provider.GetOutgoing() <- mail // wait for manual verification. line := goh.ReadLine("Did your receive an e-mail with subject \"" + mail.GetHeaders()["Subject"][0] + "\" at " + to + " [y/n]?") ok := strings.Compare("y", line) == 0 if ok == false { println("Manually Verify Email Send Failed.") } else { println("Yes mail successfully sent :-)") } }