Esempio n. 1
0
 public int SendMail(EmailEntity mail)
 {
     try
     {
         CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("InsertEmail");
         command.SetParameterValue("@Profile_name", mail.Profile_name);
         command.SetParameterValue("@Recipients", mail.Recipients);
         command.SetParameterValue("@Subject", mail.Subject);
         command.SetParameterValue("@Body", mail.Body);
         command.SetParameterValue("@RegionName", mail.RegionName);
         object obj = command.ExecuteScalar();
         return obj.ToInt32();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 2
0
 public static void SendEmail(string Recipients, string Subject,string Body,string RegionName)
 {
     EmailEntity entity = new EmailEntity()
     {
         Profile_name = ConfigurationManager.AppSettings["Mail_Profile_name"],
         Recipients = Recipients,
         Subject = Subject,
         Body = Body,
         RegionName = RegionName
     };
     RestClient.Post<int>("SendMail", entity, ConfigurationManager.AppSettings["Mail_Service"]);
 }