public void UpdateMailSettings() { SqlHelpers.Update(SqlStatements.SQL_UPDATE_MAIL_SETTINGS.FormatWith(MailServer.FixSqlString(), ServerPort, SmtpUser.FixSqlString(75), SmtpPassword.EncryptString(), FromEmail.FixSqlString(75), FromUsername.FixSqlString(75), (RequireAuth) ? "1" : "0", (RequireSsl) ? "1" : "0", Id)); _instance = LoadSystemSettings(); }
public void Logout(string username) { if (_currentUser.Username.Equals(username)) { _currentUser = _authService.GetApplicationUserProfile(_authService.GetUsernamesOfAllUsersLoggedIn().First()); } _authService.Logout(username); }
public void SwitchAccount(string username) { SmtpUser user = _authService.GetApplicationUserProfile(username); if (user != null) { _currentUser = user; } }
public SendEmailClient(string hostname, int hostport, string username, string password, SecurityEnum security) { var user = new SmtpUser(username, password); // Creo il service corretto ISmtpService smtpService = GetCorrectSmtpService(hostname, hostport, security); // Creo il client SMTP _smtpClient = user.CreateClient(smtpService); }
/// <summary> /// Returns true if ComDayCqMailerDefaultMailServiceProperties instances are equal /// </summary> /// <param name="other">Instance of ComDayCqMailerDefaultMailServiceProperties to be compared</param> /// <returns>Boolean</returns> public bool Equals(ComDayCqMailerDefaultMailServiceProperties other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( SmtpHost == other.SmtpHost || SmtpHost != null && SmtpHost.Equals(other.SmtpHost) ) && ( SmtpPort == other.SmtpPort || SmtpPort != null && SmtpPort.Equals(other.SmtpPort) ) && ( SmtpUser == other.SmtpUser || SmtpUser != null && SmtpUser.Equals(other.SmtpUser) ) && ( SmtpPassword == other.SmtpPassword || SmtpPassword != null && SmtpPassword.Equals(other.SmtpPassword) ) && ( FromAddress == other.FromAddress || FromAddress != null && FromAddress.Equals(other.FromAddress) ) && ( SmtpSsl == other.SmtpSsl || SmtpSsl != null && SmtpSsl.Equals(other.SmtpSsl) ) && ( SmtpStarttls == other.SmtpStarttls || SmtpStarttls != null && SmtpStarttls.Equals(other.SmtpStarttls) ) && ( DebugEmail == other.DebugEmail || DebugEmail != null && DebugEmail.Equals(other.DebugEmail) )); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (SmtpHost != null) { hashCode = hashCode * 59 + SmtpHost.GetHashCode(); } if (SmtpPort != null) { hashCode = hashCode * 59 + SmtpPort.GetHashCode(); } if (SmtpUser != null) { hashCode = hashCode * 59 + SmtpUser.GetHashCode(); } if (SmtpPassword != null) { hashCode = hashCode * 59 + SmtpPassword.GetHashCode(); } if (FromAddress != null) { hashCode = hashCode * 59 + FromAddress.GetHashCode(); } if (SmtpSsl != null) { hashCode = hashCode * 59 + SmtpSsl.GetHashCode(); } if (SmtpStarttls != null) { hashCode = hashCode * 59 + SmtpStarttls.GetHashCode(); } if (DebugEmail != null) { hashCode = hashCode * 59 + DebugEmail.GetHashCode(); } return(hashCode); } }
public void Login(string hostname, string username, string password) { _authService.Login(hostname, username, password); _currentUser = _authService.GetApplicationUserProfile(username); }