Пример #1
0
Файл: Email.cs Проект: lr030/ML
        public Email SetSender(IPerson person)
        {
            if (person?.Email == null || person.Name == null)
            {
                return(this);
            }

            SenderLocator = person.Locator;
            Sender        = (SerializableMailAddress) new MailAddress(person.Email, person.Name);

            return(this);
        }
Пример #2
0
Файл: Email.cs Проект: lr030/ML
        public Email SetSender(string email, string label = null)
        {
            if (email == null)
            {
                return(this);
            }

            email = email.ToLower().Trim();

            var probe = LocatorStringToPerson(email);

            if (probe != null)
            {
                SetSender(probe);
                return(this);
            }

            SenderLocator = email;
            Sender        = (SerializableMailAddress)(label == null ? new MailAddress(email) : new MailAddress(email, label));

            return(this);
        }