sitecore发送邮件功能(sitecore.MainUtil.SendMail)是否具有创建日志消息事件?
有人知道吗 Sitecoresitecore发送邮件功能(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.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)网络凭据;
}
发送(消息);
}
它不包含和记录功能,所以如果需要,您需要自己添加它