1
有誰知道 Sitecore Sitecore.MainUtil.SendMail
函數有標準的功能寫日誌約發送郵件? 它可以打開它嗎? 或者我需要使用我的自定義日誌嗎?Sitecore發送郵件功能(Sitecore.MainUtil.SendMail)是否創建了日誌消息事件?
謝謝。
有誰知道 Sitecore Sitecore.MainUtil.SendMail
函數有標準的功能寫日誌約發送郵件? 它可以打開它嗎? 或者我需要使用我的自定義日誌嗎?Sitecore發送郵件功能(Sitecore.MainUtil.SendMail)是否創建了日誌消息事件?
謝謝。
在Sitecore的6.6更新4SendMail
功能如下:
public static void SendMail(System.Net.Mail.MailMessage message)
{
string mailServer = Settings.MailServer;
SmtpClient smtpClient;
if (string.IsNullOrEmpty(mailServer))
{
smtpClient = new SmtpClient();
}
else
{
int mailServerPort = Settings.MailServerPort;
smtpClient = mailServerPort <= 0 ? new SmtpClient(mailServer) : new SmtpClient(mailServer, mailServerPort);
}
string mailServerUserName = Settings.MailServerUserName;
if (mailServerUserName.Length > 0)
{
string mailServerPassword = Settings.MailServerPassword;
NetworkCredential networkCredential = new NetworkCredential(mailServerUserName, mailServerPassword);
smtpClient.Credentials = (ICredentialsByHost) networkCredential;
}
smtpClient.Send(message);
}
它不包含和日誌功能,所以你需要,如果你需要它添加在你自己的。