Example #1
0
 public static String ToMailAddressText(Encoding encoding, TransferEncoding transferEncoding
                                        , String mailAddress, String displayName, Boolean doubleQuote)
 {
     if (String.IsNullOrEmpty(displayName) == true)
     {
         return(mailAddress);
     }
     else
     {
         if (doubleQuote == true)
         {
             return(String.Format("\"{0}\" <{1}>", displayName, mailAddress));
         }
         else
         {
             return(String.Format("{0} <{1}>"
                                  , MailParser.EncodeToMailHeaderLine(displayName, transferEncoding, encoding, MailParser.MaxCharCountPerRow - mailAddress.Length - 3)
                                  , mailAddress));
         }
     }
 }
Example #2
0
 public static String EncodeToMailHeaderLine(String text, TransferEncoding encodeType, Encoding encoding)
 {
     return(MailParser.EncodeToMailHeaderLine(text, encodeType, encoding, MailParser.MaxCharCountPerRow));
 }