-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c1ae24
commit d0c718c
Showing
5 changed files
with
34 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
using System.Collections.Generic; | ||
using System.Data.Entity; | ||
using System.Linq; | ||
using System.Net.Mail; | ||
using System.Security.Claims; | ||
using System.Threading.Tasks; | ||
using System.Web; | ||
|
@@ -18,8 +19,25 @@ public class EmailService : IIdentityMessageService | |
{ | ||
public Task SendAsync(IdentityMessage message) | ||
{ | ||
// Подключите здесь службу электронной почты для отправки сообщения электронной почты. | ||
return Task.FromResult(0); | ||
// настройка логина, пароля отправителя | ||
var from = "[email protected]"; | ||
var pass = "QWopAS12"; | ||
|
||
// адрес и порт smtp-сервера, с которого мы и будем отправлять письмо | ||
SmtpClient client = new SmtpClient("localhost", 25); | ||
|
||
client.DeliveryMethod = SmtpDeliveryMethod.Network; | ||
client.UseDefaultCredentials = false; | ||
client.Credentials = new System.Net.NetworkCredential(from, pass); | ||
//client.EnableSsl = true; | ||
|
||
|
||
// создаем письмо: message.Destination - адрес получателя | ||
var mail = new MailMessage(from, message.Destination); | ||
mail.Subject = message.Subject; | ||
mail.Body = message.Body; | ||
mail.IsBodyHtml = true; | ||
return client.SendMailAsync(mail); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@{ | ||
ViewBag.Title = "Завершение регистрации"; | ||
} | ||
|
||
<h2>@ViewBag.Title</h2> | ||
|
||
<p>На указанный электронный адрес отправлены дальнейшие инструкции по завершению регистрации</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters