{"id":176075,"date":"2013-04-09T22:56:17","date_gmt":"2013-04-09T18:56:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=176075"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=176075","title":{"rendered":"<span class=\"post_title\">ASP.NET MVC \u0423\u0440\u043e\u043a A. \u0423\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0438 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<b>\u0426\u0435\u043b\u044c \u0443\u0440\u043e\u043a\u0430<\/b> \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0438\u0441\u0435\u043c \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e\u0449\u0438\u0445 \u0441\u043c\u0441. MailNotify, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0420\u0430\u0441\u0441\u044b\u043b\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430. <\/p>\n<h5>SmtpClient \u0438 MailNotify<\/h5>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0430\u0439\u0442\u0430 \u043c\u044b \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0441 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u043e\u0439, \u0431\u0443\u0434\u044c \u0442\u043e \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u0438\u043b\u0438 \u0441\u0431\u0440\u043e\u0441 \u043f\u0430\u0440\u043e\u043b\u044c, \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438.<br \/>  \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043d\u0430\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e:  <\/p>\n<ul>\n<li>\u041a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u044b\u043b\u0430\u0442\u044c \u043f\u0438\u0441\u044c\u043c\u0430<\/li>\n<li>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f smtp \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 IConfig<\/li>\n<li>\u041e\u0448\u0438\u0431\u043a\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u044c\u043c\u0430 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f<\/li>\n<li>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e\u0447\u0442\u044b, \u0434\u0430\u0431\u044b \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u043e\u0435\u0432\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043d\u0435 \u0440\u0430\u0437\u043e\u0441\u043b\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0442\u0440\u0435\u0448.<\/li>\n<\/ul>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e MailSender (\/Tools\/Mail\/MailSender.cs):  <\/p>\n<pre><code class=\"cs\">public static class MailSender     {         private static IConfig _config;          public static IConfig Config         {             get             {                 if (_config == null)                 {                     _config = (DependencyResolver.Current).GetService&lt;IConfig&gt;();                  }                 return _config;             }         }          private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();          public static void SendMail(string email, string subject, string body, MailAddress mailAddress = null)         {              try             {                 if (Config.EnableMail)                 {                     if (mailAddress == null)                     {                         mailAddress = new MailAddress(Config.MailSetting.SmtpReply, Config.MailSetting.SmtpUser);                     }                     MailMessage message = new MailMessage(                         mailAddress,                         new MailAddress(email))                                               {                                                   Subject = subject,                                                   BodyEncoding = Encoding.UTF8,                                                   Body = body,                                                   IsBodyHtml = true,                                                   SubjectEncoding = Encoding.UTF8                                               };                     SmtpClient client = new SmtpClient                                             {                                                 Host = Config.MailSetting.SmtpServer,                                                 Port = Config.MailSetting.SmtpPort,                                                 UseDefaultCredentials = false,                                                 EnableSsl = Config.MailSetting.EnableSsl,                                                 Credentials =                                                     new NetworkCredential(Config.MailSetting.SmtpUserName,                                                                           Config.MailSetting.SmtpPassword),                                                 DeliveryMethod = SmtpDeliveryMethod.Network                                             };                     client.Send(message);                 }                 else                 {                     logger.Debug(&quot;Email : {0} {1} \\t Subject: {2} {3} Body: {4}&quot;, email, Environment.NewLine, subject, Environment.NewLine, body);                 }             }             catch (Exception ex)             {                 logger.Error(&quot;Mail send exception&quot;, ex.Message);             }         }     } <\/code><\/pre>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435:  <\/p>\n<ul>\n<li>\u041f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f IConfig \u0438\u0437 DependencyResolver<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0444\u043b\u0430\u0433 EnableMain, \u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u043e\u0447\u0442\u043e\u0439, \u0438\u043d\u0430\u0447\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0441\u044c\u043c\u043e \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u043b\u043e\u0433-\u0444\u0430\u0439\u043b<\/li>\n<li>\u0415\u0441\u043b\u0438 MailAddress \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d, \u0442\u043e \u043e\u043d \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0430<\/li>\n<li>SmtpClient \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0430<\/li>\n<li>\u0422\u0435\u043b\u043e \u043f\u0438\u0441\u044c\u043c\u0430 \u2013 html<\/li>\n<li>\u041a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u2013 UTF8<\/li>\n<li>\u0415\u0441\u043b\u0438 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u043e \u0437\u0430\u043f\u0438\u0448\u0435\u043c Exception.Message \u0432 \u043b\u043e\u0433 (\u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c, \u043d\u043e \u043f\u043e\u043a\u0430 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438).<\/li>\n<\/ul>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0443 \u043f\u0438\u0441\u0435\u043c \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 (\u0442\u043e\u0436\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439) NotifyMail (\/Tools\/Mail\/NotifyMail.cs):  <\/p>\n<pre><code class=\"cs\">public static class NotifyMail     {         private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();          private static IConfig _config;          public static IConfig Config         {             get             {                 if (_config == null)                 {                     _config = (DependencyResolver.Current).GetService&lt;IConfig&gt;();                  }                 return _config;             }         }          public static void SendNotify(string templateName, string email,             Func&lt;string, string&gt; subject,             Func&lt;string, string&gt; body)         {             var template = Config.MailTemplates.FirstOrDefault(p =&gt; string.Compare(p.Name, templateName, true) == 0);             if (template == null)             {                 logger.Error(&quot;Can't find template (&quot; + templateName + &quot;)&quot;);             }             else             {                 MailSender.SendMail(email,                     subject.Invoke(template.Subject),                     body.Invoke(template.Template));             }         }     } <\/code><\/pre>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433. \u041f\u0440\u0438 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0435 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0434\u043b\u044f \u043d\u0435\u0451, \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Func&lt;string,string&gt; \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043c\u044b \u0438 \u0442\u0435\u043b\u0430 \u043f\u0438\u0441\u044c\u043c\u0430.<\/p>\n<p>  \u0423\u0432\u0435\u0434\u043e\u043c\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0448\u0430\u0431\u043b\u043e\u043d Register \u0438\u0437 Web.config:   <\/p>\n<pre><code class=\"xml\">&lt;add name=&quot;Register&quot; subject=&quot;\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043d\u0430 {0}&quot; template=&quot;\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435! &lt;br\/&gt;&lt;br\/&gt; \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435  &lt;a href='http:\/\/{1}\/User\/Activate\/{0}'&gt;http:\/\/{1}\/User\/Activate\/{0}&lt;\/a&gt;, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0442\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u044f\u0449\u0438\u043a.&lt;br\/&gt;-----&lt;br\/&gt;\u0421 \u0443\u0432\u0430\u0436\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 &lt;a href='http:\/\/{1}'&gt;{1}&lt;\/a&gt;&quot; \/&gt; <\/code><\/pre>\n<p>  \u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u043a\u0430\u043a \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c html-\u0442\u0435\u0433\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d. \u041d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u0434\u043b\u044f string.Format() \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0412 UserController.cs \u043f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c (\/Areas\/Default\/Controllers\/UserController.cs:Register):   <\/p>\n<pre><code class=\"cs\">Repository.CreateUser(user);                  NotifyMail.SendNotify(&quot;Register&quot;, user.Email,                     subject =&gt; string.Format(subject, HostName),                     body =&gt; string.Format(body, &quot;&quot;, HostName));                  return RedirectToAction(&quot;Index&quot;); <\/code><\/pre>\n<p>  HostName \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 BaseController (\/Controllers\/BaseController.cs):  <\/p>\n<pre><code class=\"cs\">       public static string HostName = string.Empty; protected override void Initialize(System.Web.Routing.RequestContext requestContext)         {             if (requestContext.HttpContext.Request.Url != null)             {                 HostName = requestContext.HttpContext.Request.Url.Authority;             } \u2026 <\/code><\/pre>\n<p>  \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f, \u0438 \u043d\u0430 \u043d\u0430\u0448\u0443 \u043f\u043e\u0447\u0442\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043f\u0438\u0441\u044c\u043c\u043e:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/61b\/81c\/de6\/61b81cde66bd20b1bfc23cf560fcc1d4.jpg\"\/><\/p>\n<h5>\u0411\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439<\/h5>\n<p>  \u0412\u0441\u0451 \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0443 \u0441 \u043a\u0443\u0447\u0435\u0439 \u0430\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0432 Web.config, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e. \u041a\u0430\u043a \u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 html-\u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0438\u0441\u044c\u043c\u0430 \u0431\u044b\u043b\u043e \u0431\u044b \u0447\u0443\u0434\u0435\u0441\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u043e View. \u0427\u0442\u043e \u0436, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 ActionMailer (<a href=\"http:\/\/nuget.org\/packages\/ActionMailer\">http:\/\/nuget.org\/packages\/ActionMailer<\/a>):<\/p>\n<pre><code class=\"bash\">PM&gt; Install-Package ActionMailer Successfully installed 'ActionMailer 0.7.4'. Successfully added 'ActionMailer 0.7.4' to LessonProject.Model. <\/code><\/pre>\n<p>  \u041e\u0442\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c MailController \u043e\u0442 MailerBase:  <\/p>\n<pre><code class=\"cs\">public class MailController : MailerBase     {         public EmailResult Subscription(string message, string email)         {             To.Add(email);             Subject = &quot;\u0420\u0430\u0441\u0441\u044b\u043b\u043a\u0430&quot;;             MessageEncoding = Encoding.UTF8;             return Email(&quot;Subscription&quot;, message);         }      }  <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c Subscription.html.cshtml View (\/Areas\/Default\/Views\/Mail\/Subscription.html.cshtml):  <\/p>\n<pre><code class=\"html\">@model string @{     Layout = null; } &lt;!DOCTYPE html PUBLIC &quot;-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN&quot; &quot;http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd&quot;&gt; &lt;html&gt; &lt;head&gt;     &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text\/html; charset=UTF-8&quot; \/&gt;     &lt;\/head&gt; &lt;body&gt;     &lt;div&gt;         &lt;h1&gt;@Model&lt;\/h1&gt;     &lt;\/div&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 Web.config \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u043e\u0447\u0442\u043e\u0439 (Web.config):  <\/p>\n<pre><code class=\"xml\">&lt;system.net&gt;     &lt;mailSettings&gt;       &lt;smtp deliveryMethod=&quot;Network&quot; from=&quot;lxndrpetrov@gmail.com&quot;&gt;         &lt;network host=&quot;smtp.gmail.com&quot; port=&quot;587&quot; userName=&quot;lxndrpetrov&quot; password=&quot;******&quot; enableSsl=&quot;true&quot; \/&gt;       &lt;\/smtp&gt;     &lt;\/mailSettings&gt;   &lt;\/system.net&gt; <\/code><\/pre>\n<p>  \u0418 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432 UserController.cs \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 (\/Areas\/Default\/Controllers\/UserController.cs):  <\/p>\n<pre><code class=\"cs\">[Authorize]         public ActionResult SubscriptionTest()         {             var mailController = new MailController();                         var email = mailController.Subscription(&quot;\u041f\u0440\u0438\u0432\u0435\u0442, \u043c\u0438\u0440!&quot;, CurrentUser.Email);             email.Deliver();             return Content(&quot;OK&quot;);         } <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c: <\/p>\n<p>  <a href=\"http:\/\/localhost\/User\/SubscriptionTest\">localhost\/User\/SubscriptionTest<\/a> \u2014 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430 \u043f\u043e\u0447\u0442\u0443 \u043f\u0438\u0441\u044c\u043c\u043e.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u0438\u0441\u044c\u043c\u0430 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f StreamReader (\/Areas\/Default\/Controllers\/UserController.cs):  <\/p>\n<pre><code class=\"cs\">[Authorize]         public ActionResult SubscriptionShow()         {             var mailController = new MailController();             var email = mailController.Subscription(&quot;\u041f\u0440\u0438\u0432\u0435\u0442, \u043c\u0438\u0440!&quot;, CurrentUser.Email);              using (var reader = new StreamReader(email.Mail.AlternateViews[0].ContentStream))             {                 var content = reader.ReadToEnd();                 return Content(content);             }             return null;         } <\/code><\/pre>\n<p>  \u0412 content \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<br \/>  <a href=\"http:\/\/localhost\/User\/SubscriptionShow\">localhost\/User\/SubscriptionShow<\/a><br \/>  \u2003  <\/p>\n<h5>SmsNotify<\/h5>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043c\u0441, \u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0447\u0442\u044b. \u041d\u043e \u0435\u0441\u0442\u044c \u043d\u044c\u044e\u0430\u043d\u0441 \u2013 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438, \u0438 \u0442\u0443\u0442 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SMS-\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430\u043c\u0438 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 unisender.ru. <br \/>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043f\u043e \u0442\u0438\u043f\u0443 MailSetting (\/Global\/Config\/SmsSetting.cs):  <\/p>\n<pre><code class=\"cs\">public class SmsSetting : ConfigurationSection     {         [ConfigurationProperty(&quot;apiKey&quot;, IsRequired = true)]         public string APIKey         {             get             {                 return this[&quot;apiKey&quot;] as string;             }             set             {                 this[&quot;apiKey&quot;] = value;             }         }          [ConfigurationProperty(&quot;sender&quot;, IsRequired = true)]         public string Sender         {             get             {                 return this[&quot;sender&quot;] as string;             }             set             {                 this[&quot;sender&quot;] = value;             }         }          [ConfigurationProperty(&quot;templateUri&quot;, IsRequired = true)]         public string TemplateUri         {             get             {                 return this[&quot;templateUri&quot;] as string;             }             set             {                 this[&quot;templateUri&quot;] = value;             }         }     }   <\/code><\/pre>\n<p>\u0417\u0430\u0434\u0430\u0434\u0438\u043c \u0432 Web.Config (Web.config):  <\/p>\n<pre><code class=\"xml\">&lt;configSections&gt; \u2026    &lt;section name=&quot;smsConfig&quot; type=&quot;LessonProject.Global.Config.SmsSetting, LessonProject&quot; \/&gt;   &lt;\/configSections&gt; \u2026 &lt;smsConfig     apiKey=&quot;*******&quot;     sender=&quot;Daddy&quot;     templateUri=&quot;http:\/\/api.unisender.com\/ru\/api\/sendSms&quot;   \/&gt; &lt;\/configuration&gt; <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 SmsSender (\/Tools\/Sms\/SmsSender.cs):  <\/p>\n<pre><code class=\"cs\">public static class SmsSender     {         private static IConfig _config;          public static IConfig Config         {             get             {                 if (_config == null)                 {                     _config = (DependencyResolver.Current).GetService&lt;IConfig&gt;();                  }                 return _config;             }         }          private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();          public static string SendSms(string phone, string text)         {             if (!string.IsNullOrWhiteSpace(Config.SmsSetting.APIKey))             {                 return GetRequest(phone, Config.SmsSetting.Sender, text);             }             else             {                 logger.Debug(&quot;Sms \\t Phone: {0} Body: {1}&quot;, phone, text);                 return &quot;Success&quot;;             }         }          private static string GetRequest(string phone, string sender, string text)         {             try             {                 HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(Config.SmsSetting.TemplateUri);                 \/\/\/ important, otherwise the service can't desirialse your request properly                 webRequest.ContentType = &quot;application\/x-www-form-urlencoded&quot;;                 webRequest.Method = &quot;POST&quot;;                 webRequest.KeepAlive = false;                 webRequest.PreAuthenticate = false;                  string postData = &quot;format=json&api_key=&quot; + Config.SmsSetting.APIKey + &quot;&phone=&quot; + phone                     + &quot;&sender=&quot; + sender + &quot;&text=&quot; + HttpUtility.UrlEncode(text);                 var ascii = new ASCIIEncoding();                 byte[] byteArray = ascii.GetBytes(postData);                 webRequest.ContentLength = byteArray.Length;                 Stream dataStream = webRequest.GetRequestStream();                 dataStream.Write(byteArray, 0, byteArray.Length);                 dataStream.Close();                  WebResponse webResponse = webRequest.GetResponse();                  Stream responceStream = webResponse.GetResponseStream();                 Encoding enc = System.Text.Encoding.UTF8;                 StreamReader loResponseStream = new                         StreamReader(webResponse.GetResponseStream(), enc);                  string Response = loResponseStream.ReadToEnd();                 return Response;             }             catch (Exception ex)             {                 logger.ErrorException(&quot;\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 SMS&quot;, ex);                 return &quot;\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 SMS&quot;;             }         } }  <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0442\u0438\u043f\u0430:  <\/p>\n<pre><code>{&quot;result&quot;:{&quot;currency&quot;:&quot;RUB&quot;,&quot;price&quot;:&quot;0.49&quot;,&quot;sms_id&quot;:&quot;1316886153.2_79859667475&quot;}} <\/code><\/pre>\n<p>  \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0438 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. <br \/>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0443\u0440\u043e\u043a\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 json.<\/p>\n<h5>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a<\/h5>\n<p>  \u0415\u0441\u043b\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u044b\u043b\u0430\u0435\u043c \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0443\u044e \u043f\u043e\u0447\u0442\u0443 \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043b\u044e\u0434\u0435\u0439, \u0442\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u043c:  <\/p>\n<ul>\n<li>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0435\u0441\u043b\u0438 \u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043a \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435<\/li>\n<li>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0438\u0441\u044c\u043c\u0430 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0411\u0414<\/li>\n<li>\u041f\u043e\u0442\u043e\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0411\u0414 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0438\u0441\u0435\u043c<\/li>\n<li> \u041f\u0438\u0441\u044c\u043c\u0430 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u0411\u0414 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e (\u043f\u0438\u0441\u044c\u043c\u043e \u043c\u043e\u0436\u0435\u0442 \u0443\u0434\u0430\u043b\u0438\u0442\u044c\u0441\u044f, \u043c\u043e\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043d\u0443\u043b\u0438\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 (\u0447\u0442\u043e\u0431 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0411\u0414).<\/li>\n<li>\u041f\u0438\u0441\u044c\u043c\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f.<\/li>\n<li>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435.<\/li>\n<\/ul>\n<p>  \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 Application_Start. \u0422\u0430\u0439\u043c\u0435\u0440 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 1 \u043c\u0438\u043d\u0443\u0442\u0443:  <\/p>\n<pre><code class=\"cs\">public class MvcApplication : System.Web.HttpApplication     {         private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();          private Thread mailThread { get; set; }          protected void Application_Start()         {             var adminArea = new AdminAreaRegistration();             var adminAreaContext = new AreaRegistrationContext(adminArea.AreaName, RouteTable.Routes);             adminArea.RegisterArea(adminAreaContext);              var defaultArea = new DefaultAreaRegistration();             var defaultAreaContext = new AreaRegistrationContext(defaultArea.AreaName, RouteTable.Routes);             defaultArea.RegisterArea(defaultAreaContext);              FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);             RouteConfig.RegisterRoutes(RouteTable.Routes);             BundleConfig.RegisterBundles(BundleTable.Bundles);              mailThread = new Thread(new ThreadStart(ThreadFunc));             mailThread.Start();         }          private static void ThreadFunc()         {             while (true)             {                 try                 {                     var mailThread = new Thread(new ThreadStart(MailThread));                     mailThread.Start();                     logger.Info(&quot;Wait for end mail thread&quot;);                     mailThread.Join();                     logger.Info(&quot;Sleep 60 seconds&quot;);                 }                 catch (Exception ex)                 {                     logger.ErrorException(&quot;Thread period error&quot;, ex);                 }                 Thread.Sleep(60000);             }         }          private static void MailThread()         {             var repository = DependencyResolver.Current.GetService&lt;IRepository&gt;();             while (MailProcessor.SendNextMail(repository)) { }         }     } <\/code><\/pre>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043b\u0430\u0441\u0441 MailProcessor (\u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c):  <\/p>\n<pre><code class=\"cs\">public class MailProcessor     {         public static bool SendNextMail(IRepository repository)         {             var mail = repository.PopMailQueue();             if (mail != null)             {                 MailSender.SendMail(mail.Email, mail.Subject, mail.Body);                 return true;             }             return false;         } } <\/code><\/pre>\n<p>  <code>MailProcessor.SendNextMail(repository)<\/code> \u2013 \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u0438\u0441\u044c\u043c\u043e, \u0435\u0441\u043b\u0438 \u043f\u0438\u0441\u0435\u043c \u043d\u0435\u0442 \u2013 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 false<br \/>  \u041f\u043e\u0442\u043e\u043a MainThread \u0434\u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 <code>MailThread<\/code> \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043a\u0443\u0440 \u043d\u0430 \u043e\u0434\u043d\u0443 \u043c\u0438\u043d\u0443\u0442\u0443. \u0418 \u0434\u0430\u043b\u0435\u0435. \u0415\u0441\u043b\u0438 \u0432 \u0411\u0414 \u043d\u043e\u0432\u044b\u0445 \u043f\u0438\u0441\u0435\u043c \u043d\u0435\u0442 \u2013 \u0434\u0430\u043b\u044c\u0448\u0435 \u043a\u0443\u0440\u0438\u043c \u043e\u0434\u043d\u0443 \u043c\u0438\u043d\u0443\u0442\u0443.<\/p>\n<p>  \u0412\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"https:\/\/bitbucket.org\/chernikov\/lessons\">https:\/\/bitbucket.org\/chernikov\/lessons<\/a>    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/176075\/\"> http:\/\/habrahabr.ru\/post\/176075\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<b>\u0426\u0435\u043b\u044c \u0443\u0440\u043e\u043a\u0430<\/b> \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0438\u0441\u0435\u043c \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e\u0449\u0438\u0445 \u0441\u043c\u0441. MailNotify, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0420\u0430\u0441\u0441\u044b\u043b\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430. <\/p>\n<h5>SmtpClient \u0438 MailNotify<\/h5>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0430\u0439\u0442\u0430 \u043c\u044b \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0441 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u043e\u0439, \u0431\u0443\u0434\u044c \u0442\u043e \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u0438\u043b\u0438 \u0441\u0431\u0440\u043e\u0441 \u043f\u0430\u0440\u043e\u043b\u044c, \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438.<br \/>  \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043d\u0430\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e:  <\/p>\n<ul>\n<li>\u041a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u044b\u043b\u0430\u0442\u044c \u043f\u0438\u0441\u044c\u043c\u0430<\/li>\n<li>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f smtp \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 IConfig<\/li>\n<li>\u041e\u0448\u0438\u0431\u043a\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0438\u0441\u044c\u043c\u0430 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f<\/li>\n<li>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e\u0447\u0442\u044b, \u0434\u0430\u0431\u044b \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u043e\u0435\u0432\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043d\u0435 \u0440\u0430\u0437\u043e\u0441\u043b\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0442\u0440\u0435\u0448.<\/li>\n<\/ul>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-176075","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/176075","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=176075"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/176075\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=176075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=176075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=176075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}