1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System.Collections.Generic;
- using System.Net;
-
- namespace UnivateProperties_API.Model.Communication
- {
- public class SMTPHost : BaseEntity
- {
- #region Constructor
- public SMTPHost()
- {
-
- }
-
- public SMTPHost(string host, bool needsAutorize, string user, string password)
- {
- Host = host;
- User = user;
- NeedsAuthorize = needsAutorize;
- Password = password;
- }
- #endregion
-
- #region Properties
- public string Host { get; set; }
- public bool NeedsAuthorize { get; set; } = false;
- public string User { get; set; }
- public string Password { get; set; }
- public bool UseSSL { get; set; } = false;
-
- public virtual ICollection<SMTPAccount> SMTPAccounts { get; set; }
- #endregion Properties
-
- #region Methods
- public NetworkCredential GetNetworkCredential()
- {
- if (NeedsAuthorize)
- {
- return new NetworkCredential(User, Password);
- }
- return null;
- }
- #endregion
- }
- }
|