Beispiel #1
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            XtraReport report = new XtraReport7();

            report.Parameters[0].Value = "TFS";
            using (SmtpClient client = new SmtpClient("smtp.office365.com", 587))
            {
                using (MailMessage message = report.ExportToMail("*****@*****.**", txtTFS.Text
                                                                 , "TFS DSR"))
                {
                    client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "@x365dyn@20!9");
                    // client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "pass@word1");
                    client.EnableSsl = true;
                    client.Send(message);
                }
            }
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            XtraReport report = new XtraReport7();

            report.Parameters[0].Value = "TFS";

            using (SmtpClient client = new SmtpClient("smtp.office365.com", 587))
            {
                using (MailMessage message = report.ExportToMail("*****@*****.**",
                                                                 "*****@*****.**", "SPF DSR"))
                {
                    client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "pass@word1");
                    client.EnableSsl   = true;
                    client.Send(message);
                }
            }
        }