当前位置: 首页>>代码示例>>C#>>正文


C# IEmailSender.Send方法代码示例

本文整理汇总了C#中IEmailSender.Send方法的典型用法代码示例。如果您正苦于以下问题:C# IEmailSender.Send方法的具体用法?C# IEmailSender.Send怎么用?C# IEmailSender.Send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEmailSender的用法示例。


在下文中一共展示了IEmailSender.Send方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendTaskAssignedEmail

 public static void SendTaskAssignedEmail(TaskAssignedEmailViewModel viewModel, IEmailSender emailSender, bool isActionTask = false)
 {
     var email = (isActionTask) ? 
         new MailerController().ActionTaskAssigned(viewModel) :
         new MailerController().TaskAssigned(viewModel);
     emailSender.Send(email);
 }
开发者ID:mnasif786,项目名称:Business-Safe,代码行数:7,代码来源:SendTaskAssignedEmailHelper.cs

示例2: SendXmlMailUsingStringTemplateFormatter

 /// <summary>
 /// Sends the XML mail using string template formatter.
 /// </summary>
 /// <param name="xmlTemplate">The XML template.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="sender">The sender.</param>
 public static void SendXmlMailUsingStringTemplateFormatter(XmlDocument xmlTemplate, ParameterCollection parameters, IEmailSender sender)
 {
     EmailTemplate template = new XmlEmailTemplate(xmlTemplate);
     IEmailFormatter formatter = new StringTemplateEmailFormatter();
     sender.Send(template, formatter, parameters);
 }
开发者ID:hellangle,项目名称:NewCenturyLogistic,代码行数:12,代码来源:EmailUtility.cs

示例3: SendXmlMail

 /// <summary>
 /// Sends the XML mail.
 /// </summary>
 /// <param name="xmlTemplateFileName">Name of the XML template file.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="sender">The sender.</param>
 public static void SendXmlMail(string xmlTemplateFileName, ParameterCollection parameters, IEmailSender sender)
 {
     EmailTemplate template = new XmlEmailTemplate(xmlTemplateFileName);
     IEmailFormatter formatter = new XmlTemplateEmailFormatter();
     sender.Send(template, formatter, parameters);
 }
开发者ID:hellangle,项目名称:NewCenturyLogistic,代码行数:12,代码来源:EmailUtility.cs

示例4: DoWork

        public void DoWork(IlluminateDatabase database,IEmailSender emailSender)
        {
            Logger.Information("EmailDailyTasks started");
            
            

            //we need to get a list of tasks that are Overdue, duetoday or due tomorrow. 
            foreach (var db in database.GetAllOrgStores())
            {
                Currentstore = db; 

                List<User> users;
                using (var session = db.OpenSession())
                {
                    users = session.Query<User>().ToList();
                }

                //get the tasks etc for this user. 
                foreach (var user in users)
                {
                    Currentuser = user; 


                    //set culture
                    Thread.CurrentThread.CurrentCulture = user.Culture;


                    var bodyBuilder = new StringBuilder(); 

                    using (var session = db.OpenSession()) //smaller sessions
                    {
                        var targetuser = user;

                        var tasks =
                            session.Query<Task>()
                                    .Where(
                                        x =>
                                        x.ConsolidatedAssignees.Any(a => a.UserId == targetuser.Id) &&
                                        x.DueDate <= DateTime.Today.AddDays(3) && x.CompletedDate == null);
                            
                        var meetings =
                            session.Query<Meeting>()
                                    .Where(
                                        x =>
                                        x.Invitees.Any(i => i.UserId == targetuser.Id) &&
                                        x.DueDate <= DateTime.Today.AddDays(3) &&
                                        x.DueDate >= DateTime.Today); 

                        var items = new List<TimelineItem>();

                        items.AddRange(tasks.ToList().ToTimelineItems());
                        items.AddRange(meetings.ToList().ToTimelineItems());

                        Logger.Information("{0} items for {1}", items.Count, targetuser.Name);

                        var sectionbuilder = new StringBuilder();

                       
                        if (items.Count > 0)
                        {
                         

                            var overduelines =
                                (from i in items
                                    where i.start.Date < DateTime.Today
                                    orderby i.start ascending
                                 select FormatItem(i));
                            sectionbuilder.AppendLine(SubHeader("Overdue tasks"));
                            
                            if (overduelines.Any())
                            {
                                sectionbuilder.Append(String.Join("\n", overduelines.ToList()));
                            }
                            else
                            {
                                sectionbuilder.AppendLine("No items to show<br/>"); 
                            }

                            sectionbuilder.AppendLine("<br/>"); 

                            var todaylines =
                                (from i in items
                                 where i.start.Date == DateTime.Today
                                 orderby i.start ascending
                                 select FormatItem(i));


                            sectionbuilder.AppendLine(SubHeader("Today's tasks"));
                            
                            if (todaylines.Any())
                            {
                                sectionbuilder.Append(String.Join("\n", todaylines.ToList()));
                            }
                            else
                            {
                                sectionbuilder.AppendLine("No items to show<br/>");
                            }

                            sectionbuilder.AppendLine("<br/>");

//.........这里部分代码省略.........
开发者ID:andyevans2000,项目名称:Illuminate,代码行数:101,代码来源:EmailDailyTasks.cs

示例5: SendReviewAssignedEmail

 public static void SendReviewAssignedEmail(ReviewAssignedEmailViewModel viewModel, IEmailSender emailSender)
 {
     var email = new MailerController().ReviewAssigned(viewModel);
     emailSender.Send(email);
 }
开发者ID:mnasif786,项目名称:Business-Safe,代码行数:5,代码来源:SendReviewAssignedEmailHelper.cs


注:本文中的IEmailSender.Send方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。