Example #1
0
 public static bool IsValidDomain(string domain)
 {
     if (domain == null)
     {
         throw new ArgumentNullException("domain");
     }
     return(MimeInternalHelpers.IsValidDomain(domain, 0, true, MimeInternalHelpers.IsEaiEnabled()) && !SmtpAddress.IsDomainIPLiteral(domain));
 }
Example #2
0
 public byte[] GetBytes()
 {
     if (this.address == null)
     {
         return(null);
     }
     return(MimeInternalHelpers.StringToBytes(this.address, MimeInternalHelpers.IsEaiEnabled()));
 }
Example #3
0
        public int GetBytes(byte[] array, int offset)
        {
            if (array == null)
            {
                throw new ArgumentNullException("array");
            }
            if (0 > offset)
            {
                throw new ArgumentOutOfRangeException("offset");
            }
            if (this.address == null)
            {
                return(0);
            }
            int length = this.Length;

            if (length == 0)
            {
                return(0);
            }
            if (length > array.Length - offset)
            {
                throw new ArgumentException(DataStrings.InsufficientSpace);
            }
            return(MimeInternalHelpers.StringToBytes(this.address, 0, length, array, offset, MimeInternalHelpers.IsEaiEnabled()));
        }
Example #4
0
        public static bool IsValidSmtpAddress(string address)
        {
            if (address == null)
            {
                throw new ArgumentNullException("address");
            }
            int domainStart;

            return((MimeInternalHelpers.IsValidSmtpAddress(address, true, out domainStart, MimeInternalHelpers.IsEaiEnabled()) && !SmtpAddress.IsDomainIPLiteral(address, domainStart)) || address == SmtpAddress.NullReversePath.address);
        }