| | 1 | | using Microsoft.AspNetCore.Identity.UI.Services; |
| | 2 | | using System; |
| | 3 | | using System.Collections.Generic; |
| | 4 | | using System.Linq; |
| | 5 | | using System.Net; |
| | 6 | | using System.Net.Mail; |
| | 7 | | using System.Text; |
| | 8 | | using System.Threading.Tasks; |
| | 9 | |
|
| | 10 | | namespace MUNity.Services |
| | 11 | | { |
| | 12 | | public class MailService : IMailService |
| | 13 | | { |
| | 14 | | public Task SendEmailAsync(string email, string subject, string htmlMessage) |
| 0 | 15 | | { |
| 0 | 16 | | throw new NotImplementedException(); |
| | 17 | | } |
| | 18 | |
|
| | 19 | | public void SendMail(string target, string title, string content) |
| 0 | 20 | | { |
| 0 | 21 | | var client = new SmtpClient("smtp.mailtrap.io", 2525) |
| 0 | 22 | | { |
| 0 | 23 | | Credentials = new NetworkCredential("056044a17ce7ee", "b8506b064d1b43"), |
| 0 | 24 | | EnableSsl = true |
| 0 | 25 | | }; |
| 0 | 26 | | client.Send("no-reply@munity.org", target, title, content); |
| 0 | 27 | | } |
| | 28 | |
|
| | 29 | | } |
| | 30 | | } |