public static bool smtpAuthentication(string hostSMTP, int portSMTP, string userName, string password) { MailMan smtpTest = new MailMan(); smtpTest.SmtpHost = hostSMTP; smtpTest.SmtpPort = portSMTP; smtpTest.SmtpUsername = userName; smtpTest.SmtpPassword = password; if (SSL) smtpTest.PopSsl = true; else smtpTest.PopSsl = false; Email mail = new Email(); mail.From = userName; mail.AddTo("", userName); mail.Subject = "Test mail"; mail.SetHtmlBody("<html><body><b><font color='red' size='+1'>Thư kiểm tra</font></b></html>"); if (smtpTest.SendEmail(mail)) return true; else return false; }