本文整理汇总了C#中Kooboo.CMS.Sites.Models.Site.SendMailToSiteManager方法的典型用法代码示例。如果您正苦于以下问题:C# Site.SendMailToSiteManager方法的具体用法?C# Site.SendMailToSiteManager怎么用?C# Site.SendMailToSiteManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kooboo.CMS.Sites.Models.Site
的用法示例。
在下文中一共展示了Site.SendMailToSiteManager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendMail
protected virtual void SendMail(ControllerContext controllerContext, Site site, ContactSiteModel ContactSiteModel, HttpFileCollectionBase files) {
var from = ContactSiteModel.From;
var subject = ContactSiteModel.Subject;
var body = string.Format(ContactSiteModel.EmailBody ,ContactSiteModel.From, ContactSiteModel.Subject, ContactSiteModel.Body);
site.SendMailToSiteManager(from, subject, body, true , files);
}
示例2: SendMail
public void SendMail(Site site, string from, string subject, string body, bool? isBodyHtml, HttpFileCollectionBase files)
{
site.SendMailToSiteManager(from, subject, body, isBodyHtml == null ? false : isBodyHtml.Value, files);
}
示例3: SendLog
private void SendLog(PublishingLog item)
{
if (!string.IsNullOrEmpty(item.SiteName))
{
var site = new Site(item.SiteName).AsActual();
//have set smtp
if (site != null && site.Smtp != null && !string.IsNullOrEmpty(site.Smtp.Host) && !string.IsNullOrEmpty(site.Smtp.From)
&& site.Smtp.To != null && site.Smtp.To.Length > 0)
{
var logMessage = @"
Log type : {0},
Action : {1},
Item type : {2},
Title : {3},
Object UUID : {4}
Remote sites: {5},
Folder mapping:{6},
User : {7},
Status : {8}
Processed time:{9},
Message : {10},
Stack trace : {11}
";
logMessage = string.Format(logMessage, item.QueueType,
item.PublishingAction,
item.PublishingObject,
item.ObjectTitle,
item.ObjectUUID,
string.IsNullOrEmpty(item.RemoteEndpoint) ? "-" : item.RemoteEndpoint,
string.IsNullOrEmpty(item.TextFolderMapping) ? "-" : item.TextFolderMapping,
string.IsNullOrEmpty(item.UserId) ? "-" : item.UserId,
item.Status,
item.UtcProcessedTime.Value.ToLocalTime(),
string.IsNullOrEmpty(item.Message) ? "-" : item.Message,
string.IsNullOrEmpty(item.StackTrace) ? "-" : item.StackTrace);
site.SendMailToSiteManager(site.Smtp.From, "Publishing log", logMessage, false);
}
}
}