PageRenderTime 19ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/BaliEnterpriseSystems/BaliEnterpriseSystems/BestObjects/BestEMail.cs

https://github.com/sirivedula/BEST
C# | 59 lines | 52 code | 7 blank | 0 comment | 0 complexity | 9a87c94fb824840b02a1a4e27d52c0f0 MD5 | raw file
 1using System;
 2using System.Data;
 3using System.Configuration;
 4using System.Linq;
 5using System.Web;
 6using System.Web.Security;
 7using System.Web.UI;
 8using System.Web.UI.HtmlControls;
 9using System.Web.UI.WebControls;
10using System.Web.UI.WebControls.WebParts;
11using System.Xml.Linq;
12using System.Net.Mail;
13
14namespace BaliEnterpriseSystems.BestObjects
15{
16    public class BestEMail
17    {
18        public BestEMail()
19        {
20
21        }
22
23        public void SendEMail()
24        {
25            MailMessage mail = new MailMessage();
26            mail.To.Add(this.ToMail);
27            mail.From = new MailAddress(this.FromMail);
28            mail.Subject = this.Subject;
29            mail.Body = this.Body;
30            SmtpClient smtp = new SmtpClient();
31            smtp.Host = ConfigurationManager.AppSettings["SMTP"];
32            smtp.Send(mail);
33        }
34
35        public string ToMail
36        {
37            get;
38            set;
39        }
40
41        public string Subject
42        {
43            get;
44            set;
45        }
46
47        public string Body
48        {
49            get;
50            set;
51        }
52
53        public string FromMail
54        {
55            get;
56            set;
57        }
58    }
59}