-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmail.cs
More file actions
70 lines (62 loc) · 1.74 KB
/
Copy pathEmail.cs
File metadata and controls
70 lines (62 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* Created by SharpDevelop.
* User: Maura
* Date: 11/3/2012
* Time: 3:23 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Net.Mail;
namespace PerfectPlacement
{
/// <summary>
/// Description of Email.
/// </summary>
public class Email
{
public Email()
{
}
public void Send(Contact contact)
{
// MailMessage mail = new MailMessage(
// "solutions@pps-az.com",
// "solutions@pps-az.com",
// "testing",
// "test message");
// new SmtpClient("smtp.secureserver.net").Send(mail);
//new SmtpClient().
string fromAddress = "solutions@pps-az.com";
string sendToAddress = "solutions@pps-az.com";
SmtpClient client = new SmtpClient("relay-hosting.secureserver.net");
MailAddress from = new MailAddress(fromAddress);
MailAddress to = new MailAddress(sendToAddress);
MailMessage message = new MailMessage(from, to);
message.Body = "This is a test";
message.IsBodyHtml = true;
message.Subject = "Submission";
client.Send(message);
}
}
public class Contact
{
public string Name { get; set; }
public string FromEmailAddress { get; set; }
public string ToEmailAddress { get; set; }
public string Subject { get; set; }
public string Message { get; set; }
}
// TODO : Change from static class to use interface and IoC
/// <summary>
/// Email Service
/// </summary>
public static class EmailService
{
public static void SendEmail(MailMessage mailMessage)
{
SmtpClient client = new SmtpClient("relay-hosting.secureserver.net");
client.Send(mailMessage);
}
}
}