Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
sitecore发送邮件功能(sitecore.MainUtil.SendMail)是否具有创建日志消息事件?_Sitecore_Sitecore6 - Fatal编程技术网

sitecore发送邮件功能(sitecore.MainUtil.SendMail)是否具有创建日志消息事件?

sitecore发送邮件功能(sitecore.MainUtil.SendMail)是否具有创建日志消息事件?,sitecore,sitecore6,Sitecore,Sitecore6,有人知道吗 SitecoreSitecore.MainUtil.SendMail函数是否具有编写已发送邮件日志的标准功能? 可以把它打开吗? 或者我需要使用我的自定义日志吗 谢谢。在Sitecore 6.6更新4中发送邮件功能如下所示: public static void SendMail(System.Net.Mail.MailMessage message) { string mailServer = Settings.MailServer; SmtpClient smtpClie

有人知道吗 Sitecore
Sitecore.MainUtil.SendMail
函数是否具有编写已发送邮件日志的标准功能? 可以把它打开吗? 或者我需要使用我的自定义日志吗


谢谢。

Sitecore 6.6更新4中
发送邮件
功能如下所示:

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);
}
publicstaticvoidsendmail(System.Net.Mail.MailMessage)
{
字符串mailServer=Settings.mailServer;
SmtpClient SmtpClient;
if(string.IsNullOrEmpty(mailServer))
{
smtpClient=新的smtpClient();
}
其他的
{
int mailServerPort=Settings.mailServerPort;
smtpClient=mailServerPort 0)
{
字符串mailServerPassword=Settings.mailServerPassword;
NetworkCredential NetworkCredential=新的网络凭据(mailServerUserName、mailServerPassword);
smtpClient.Credentials=(ICredentialsByHost)网络凭据;
}
发送(消息);
}

它不包含和记录功能,因此如果需要,您需要自己添加它。

Sitecore 6.6更新4中
SendMail
功能如下所示:

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);
}
publicstaticvoidsendmail(System.Net.Mail.MailMessage)
{
字符串mailServer=Settings.mailServer;
SmtpClient SmtpClient;
if(string.IsNullOrEmpty(mailServer))
{
smtpClient=新的smtpClient();
}
其他的
{
int mailServerPort=Settings.mailServerPort;
smtpClient=mailServerPort 0)
{
字符串mailServerPassword=Settings.mailServerPassword;
NetworkCredential NetworkCredential=新的网络凭据(mailServerUserName、mailServerPassword);
smtpClient.Credentials=(ICredentialsByHost)网络凭据;
}
发送(消息);
}
它不包含和记录功能,所以如果需要,您需要自己添加它