コード例 #1
0
        private void SendEmail(LinkedList<string> to, string from, string subj, string body)
        {
            LinkedList<string> _from = new LinkedList<string>();

            //var attatchments = new LinkedList<string>();

            //attatchments.AddLast(HttpContext.Current.Server.MapPath("~/Images/calendar.gif"));

            _from.AddLast(from);

            Mail mail = new Mail()
            {
                From = _from,

                To = to,

                Subject = subj,

                Body = body.Replace("@Link", "cced.dtop.gov.pr/exc/"),

                SMTPPort = 587,// 587 o 25

                //SMTPHost = "smtp.gmail.com"

            };

            new Email().SendEmail(mail);
        }
コード例 #2
0
ファイル: Email.cs プロジェクト: ijustarrived/EXC
        public void SendEmail(Mail email)
        {
            //email.SMTPHost = "smtp.gmail.com";

            email.SMTPHost = "echo.dtop.gov.pr";

            MailMessage msg = new MailMessage();

            SmtpClient client = new SmtpClient();

            client.Port = 25;

            client.DeliveryMethod = SmtpDeliveryMethod.Network;

            client.UseDefaultCredentials = false;

            client.Host = email.SMTPHost;

            //client.EnableSsl = true;

            client.Credentials = new System.Net.NetworkCredential(email.From.ElementAt(0), @"Apoyo2015");           

            //client.Credentials = new System.Net.NetworkCredential(email.From.ElementAt(0), @"excavaciones");

            msg = ComposeEmail(email.To, email.From.ElementAt(0), email.Subject, email.Body, email.Attachments);

            client.Send(msg);
        }
コード例 #3
0
ファイル: Extension1.aspx.cs プロジェクト: ijustarrived/EXC
        private void SendEmail(LinkedList<string> to, string from, string subj, string body, LinkedList<string> attach)
        {
            LinkedList<string> _from = new LinkedList<string>();

            _from.AddLast(from);

            Mail mail = new Mail()
            {
                From = _from,

                To = to,

                Subject = subj,

                Body = body.Replace("@Link", "cced.dtop.gov.pr/exc/"),

                SMTPPort = 587,// 587 o 25

                //SMTPHost = "echo.dtop.gov.pr",

                Attachments = attach

            };

            new Email().SendEmail(mail);
        }
コード例 #4
0
ファイル: Mensajero.aspx.cs プロジェクト: ijustarrived/EXC
        private void SendEmail(LinkedList<string> to, string from, string subj, string body)
        {
            var _from = new LinkedList<string>();

            _from.AddLast(from);

            Mail mail = new Mail()
            {
                From = _from,

                To = to,

                Subject = subj,

                Body = body.Replace("@Link", "cced.dtop.gov.pr/exc/"),

                SMTPPort = 25, // test only

                //SMTPHost = "echo.dtop.gov.pr" // test only
            };

            new Email().SendEmail(mail);
        }