aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcinzelent <zelent.marcin@gmail.com>2018-03-16 21:40:28 +0100
committermarcinzelent <zelent.marcin@gmail.com>2018-03-16 21:40:28 +0100
commit08e7a82cc7b237e550c0236bebd4f41c3c3f4acf (patch)
tree30e2320d62f2bf3981120ad76f2de92efec1e8f5 /PollutometerWebApi/EmailSender.cs
parent9441b9d8b3035dc3142234dd13a1bcea21e72749 (diff)
Moved API to separate folder.
Diffstat (limited to 'PollutometerWebApi/EmailSender.cs')
-rw-r--r--PollutometerWebApi/EmailSender.cs34
1 files changed, 0 insertions, 34 deletions
diff --git a/PollutometerWebApi/EmailSender.cs b/PollutometerWebApi/EmailSender.cs
deleted file mode 100644
index 6cc60fc..0000000
--- a/PollutometerWebApi/EmailSender.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System;
-using System.Net.Mail;
-using PollutometerWebApi.Models;
-
-namespace PollutometerWebApi
-{
- public static class EmailSender
- {
- public static void SendEmail(Aqi aqi)
- {
- MailMessage mail = new MailMessage("***REMOVED***", "alek2026@edu.easj.dk");
- SmtpClient client = new SmtpClient()
- {
- Host = "mail.cock.li",
- Port = 587,
- EnableSsl = true,
- Timeout = 100,
- DeliveryMethod = SmtpDeliveryMethod.Network,
- UseDefaultCredentials = false,
- Credentials = new System.Net.NetworkCredential("***REMOVED***", "***REMOVED***")
- };
- mail.Subject = $"Pollutometer warning - {DateTime.Now}";
- mail.IsBodyHtml = true;
- mail.Body = "<h3>WARNING!</h3>\n" +
- "\n" +
- "<img src=\"https://i.imgflip.com/20b4q2.jpg\"/>\n" +
- "\n" +
- $"<p>The warning was triggered by {aqi.GasName}.</p>\n" +
- $"<p>Air quality index: {aqi.Value}</p>" +
- $"<p>The AQI level is {aqi.Level}!";
- client.Send(mail);
- }
- }
-} \ No newline at end of file