/// <summary> /// Return a new instance of SmtpClient initializate with the values for the company smtpClient specifies in smtpClientType /// </summary> /// <param name="smtpClientType">smtpClient company type</param> /// <returns></returns> public static SmtpClient GetSmtpClient(SmtpClientType smtpClientType) { switch (smtpClientType) { case SmtpClientType.Gmail: return(Gmail); default: AppLogger.Error(String.Format("stmpClientType '{0}' not supported", smtpClientType)); throw new ArgumentException(String.Format("stmpClientType '{0}' not supported", smtpClientType)); } }
public Email(String userName, String userPassword, SmtpClientType clientType) { _smtpClient = SmtpClientFactory.GetSmtpClient(clientType); _smtpClient.Credentials = new NetworkCredential(userName, userPassword); }