[摘要]RegexOptions.Multiline; } return (SqlBoolean)(Regex.IsMatch(source, pattern, regexOptions)); } /// ...
RegexOptions.Multiline;
}
return (SqlBoolean)(Regex.IsMatch(source, pattern, regexOptions));
}
///
/// 发送邮件
///
///收件人邮件地址
///发件人邮件地址
///邮件主题
///邮件内容
///登录smtp主机时用到的用户名,注意是邮件地址'@'以前的部分
///登录smtp主机时用到的用户密码
///发送邮件用到的smtp主机
[SqlProcedure]
[SmtpPermission(SecurityAction.Assert)]
[SecurityPermission(SecurityAction.Assert)]
public static void SendMail(string to, string from, string subject, string body, string userName, string password, string smtpHost)
{
MailAddress addressFrom = new MailAddress(from);
MailAddress addressTo = new MailAddress(to);
MailMessage message = new MailMessage(addressFrom, addressTo);
message.Subject = subject;//设置邮件主题
message.IsBodyHtml = true;//设置邮件正文为html格式
message.Body = body;//设置邮件内容
SmtpClient client = new SmtpClient(smtpHost);
//设置发送邮件身份验证方式
//注意如果发件人地址是abc@def.com,则用户名是abc而不是abc@def.com
client.Credentials = new NetworkCredential(userName, password);
client.Send(message);
}
}
}
……