public static bool SendMailUseGmail(EmailDetail content)
        {
            bool        hasSend = true;
            MailMessage msg     = new MailMessage();

            GenerateMailMsg(content, msg);
            SmtpClient client = new SmtpClient();

            client.Host = content.SendServer;
            client.Port = int.Parse(content.Port);
            client.UseDefaultCredentials = false;
            client.Credentials           = new NetworkCredential(content.SendAddress, MD5Encrypt(content.Password, "angusesd"));
            client.DeliveryMethod        = SmtpDeliveryMethod.Network;

            try
            {
                client.Send(msg);
            }
            catch (SmtpException ex)
            {
                AppLogger.Error(ex.Message, ex.InnerException);
                hasSend = false;
            }

            return(hasSend);
        }
 private static void GenerateMailMsg(EmailDetail content, MailMessage msg)
 {
     AddRecipients(content.Recipients, msg);
     AddCopies(content.Cc, msg);
     msg.From            = new MailAddress(content.SendAddress, content.Theme, Encoding.UTF8);
     msg.Subject         = content.Theme;
     msg.SubjectEncoding = Encoding.UTF8;
     msg.Body            = content.Body;
     msg.Attachments.Add(new Attachment(content.Attachment));
     msg.BodyEncoding = Encoding.UTF8;
     msg.IsBodyHtml   = true;
     msg.Priority     = MailPriority.High;
 }