コード例 #1
0
ファイル: SendMail.aspx.cs プロジェクト: elshiekh5/CMS.V6
    protected void Page_Load(object sender, EventArgs e)
    {
        LocalEmailService.EmailService service = new LocalEmailService.EmailService();

        service.BeginSendMail(ConfigurationManager.AppSettings["MailFrom"], "*****@*****.**", "xxxxxxxx", "أكد الكابتن هادى خشبه مدير الكرة بالنادى الأهلى فى تصريحات تلفزيونية أن محمد فضل مهاجم الفريق سوف يعود من ألمانيا غدا الثلاثاء بعد ان اثبتت الاشعة عدم", new AsyncCallback(OnSendMail), null);
        //////System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();

        //////mail.To.Add("*****@*****.**");
        //////mail.Subject = "تجربة ارسال ميل";
        //////mail.IsBodyHtml = true;
        //////mail.Body = "يارب يوصل";

        //////System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient();


        //////smtp.Send(mail);


        Response.Write(DateFormat.ArabicCalCustom(DateTime.Now, true));

        //System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();

        //mail.To.Add("*****@*****.**");
        //mail.Subject = "dddddddddddddd";

        //mail.From = new System.Net.Mail.MailAddress("*****@*****.**");
        //mail.IsBodyHtml = true;
        //mail.Body = "dddddddddddddd";

        //System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient();
        //smtp.EnableSsl = true;


        //string portNum = ConfigurationManager.AppSettings["MailSMTPPort"];
        //string userName = ConfigurationManager.AppSettings["MailUserName"];
        //string password = ConfigurationManager.AppSettings["MailPassWord"];
        ////mail.Headers.Add("Disposition-Notification-To", ConfigurationManager.AppSettings["MailFrom"]);
        //mail.Headers.Add("Return-Path", ConfigurationManager.AppSettings["MailFrom"]);

        ////for SMTP Authentication
        //System.Net.NetworkCredential net = new System.Net.NetworkCredential(userName, password);
        //smtp.Credentials = net;

        //mail.Headers.Add("X-CS-EmailID", Guid.NewGuid().ToString());
        //mail.Headers.Add("X-CS-ThreadId", Thread.CurrentThread.ManagedThreadId.ToString());
        //mail.Headers.Add("X-CS-Attempts", "1");
        //mail.Headers.Add("X-CS-AppDomain", AppDomain.CurrentDomain.FriendlyName);
        //mail.BodyEncoding = Encoding.GetEncoding(1256);
        //mail.SubjectEncoding = Encoding.GetEncoding(1256);
        //mail.DeliveryNotificationOptions = DeliveryNotificationOptions.None;

        //mail.IsBodyHtml = true;
        //smtp.Send(mail);
    }