난잡한 코드
6930 단어 code
/// <summary>
///
/// </summary>
/// <param name="fromEmails"> </param>
/// <param name="myEmail"> </param>
/// <param name="name"> </param>
/// <param name="title"> </param>
/// <param name="conent"> </param>
/// <returns></returns>
public static Boolean SendMail(String[] fromEmails, String myEmail, String name, String title, String content)
{
try
{
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
foreach (String email in fromEmails)
{
msg.To.Add(email);
}
msg.From = new MailAddress(myEmail, name);
/* 3 ( ), , */
msg.Subject = title;//
msg.SubjectEncoding = System.Text.Encoding.UTF8;//
msg.Body = content;//
msg.BodyEncoding = System.Text.Encoding.UTF8;//
msg.IsBodyHtml = true;// HTML
msg.Priority = System.Net.Mail.MailPriority.High;
SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(myEmail, "");// szmorning.com.cn
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;// , , Network , , PickupDirectoryFromIis IIS OK
client.Send(msg);
return true;
}
catch (System.Net.Mail.SmtpException ex)
{
String message = ex.Message;
return false;
}
}
:
<system.net>
<mailSettings>
<smtp>
<!--<network host="mail.chevroletsingapore.com" userName="[email protected]" password="password"/>-->
<network host=" "/> //163.com
</smtp>
</mailSettings>
</system.net>
url
protected static Boolean IsMatchUrl(String path)
{
String regExp = String.Empty;
regExp = @"^((https|http|ftp|rtsp|mms)?://)"
+ @"?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" //ftp user@
+ @"(([0-9]{1,3}\.){3}[0-9]{1,3}" // IP URL- 221.2.162.15
+ @"|" // IP DOMAIN( )
+ @"([0-9a-z_!~*'()-]+\.)*" // - www.
+ @"([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\." //
+ @"[a-z]{2,6})" // first level domain- .com or .museum
+ @"(:[0-9]{1,4})?" // - :80
+ @"((/?)|" // a slash isn't required if there is no file name
+ @"(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$";
regex = new Regex(regExp);
return regex.IsMatch(path);
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Visual Studio 코드에 무료 Cursive(Italic) 글꼴 추가우리 모두는 기능과 확장성 때문에 Visual Studio 코드 편집기를 좋아합니다. 이 기사에서는 필기체(이탤릭체) 글꼴을 완전 무료로 설정하는 방법에 대한 유용한 팁을 보여드리겠습니다. 그 때문에 사람들은 Ope...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.