aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcinzelent <zelent.marcin@gmail.com>2017-12-01 14:56:49 +0100
committermarcinzelent <zelent.marcin@gmail.com>2017-12-01 14:56:49 +0100
commitb7757c89b6576cfc33579f1dec118086e159e03e (patch)
tree286954152dc582b5f20138dd40c61e096319fc9a /PollutometerWebApi/EmailSender.cs
parentc8f0195ccc06575349c0e675c23276ac089bf9c7 (diff)
Added method for sending e-mail.
Diffstat (limited to 'PollutometerWebApi/EmailSender.cs')
-rw-r--r--PollutometerWebApi/EmailSender.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/PollutometerWebApi/EmailSender.cs b/PollutometerWebApi/EmailSender.cs
new file mode 100644
index 0000000..0e328c9
--- /dev/null
+++ b/PollutometerWebApi/EmailSender.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Net.Mail;
+
+namespace PollutometerWebApi
+{
+ public class EmailSender
+ {
+ public EmailSender() {}
+
+ public static void SendEmail()
+ {
+ MailMessage mail = new MailMessage("***REMOVED***", "***REMOVED***@edu.easj.dk");
+ SmtpClient client = new SmtpClient()
+ {
+ Host = "mail.cock.li",
+ Port = 465,
+ DeliveryMethod = SmtpDeliveryMethod.Network,
+ UseDefaultCredentials = false,
+ Credentials = new System.Net.NetworkCredential("***REMOVED***", "***REMOVED***")
+ };
+ mail.Subject = "this is a test email.";
+ mail.Body = "this is my test email body";
+ client.Send(mail);
+ }
+ }
+} \ No newline at end of file