Ejemplo n.º 1
0
        private void DergoEmail(int idKerkesa, DateTime dtTani, int nrSMS, int alg)
        {
            try
            {
                EnhancedMailMessage msg = new EnhancedMailMessage();

                msg.From     = "*****@*****.**";
                msg.FromName = "Kerkese SMS";
                msg.To       = "*****@*****.**";
                msg.Subject  = Main.emriShkolla;
                string body = "Të dhënat për kërkësën: " + Environment.NewLine;
                body += "ID KERKESA:  " + idKerkesa.ToString() + Environment.NewLine;
                body += "DATA/ORA:  " + dtTani.ToString("dd.MM.yyyy HH:mm") + Environment.NewLine;
                body += "NR SERIAL SHKOLLA:  " + Main.serial + Environment.NewLine;
                body += "NR SMS:  " + nrSMS.ToString() + Environment.NewLine;
                body += "ALGORITMI:  " + alg.ToString() + Environment.NewLine;
                body += Environment.NewLine;

                body += "Koment shtesë" + Environment.NewLine;
                body += txtKoment.Text;

                msg.Body = body;

                msg.SMTPServerName   = "smtp.gmail.com";
                msg.SMTPUserName     = "******";
                msg.SMTPUserPassword = "******";
                msg.SMTPServerPort   = 465;
                msg.SMTPSSL          = true;
                msg.Send();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Ejemplo n.º 2
0
        public static void QuickSend(
            string SMTPServerName,
            string ToEmail,
            string FromEmail,
            string Subject,
            string Body,
            MailFormat BodyFormat)
        {
            EnhancedMailMessage msg = new EnhancedMailMessage();

            msg.From       = FromEmail;
            msg.To         = ToEmail;
            msg.Subject    = Subject;
            msg.Body       = Body;
            msg.BodyFormat = BodyFormat;

            msg.SMTPServerName = SMTPServerName;
            msg.Send();
        }