Пример #1
0
 protected void submit_Click(object sender, EventArgs e)
 {
     Ektron.Cms.CommonApi commonApi = new Ektron.Cms.CommonApi();
     Ektron.Cms.Common.EkMailService mailService = new Ektron.Cms.Common.EkMailService(commonApi.RequestInformationRef);
     try
     {
         mailService.MailServer = "EmailServerIP".GetAppKeyString();
         mailService.ServerPort = "EmailServerPort".GetAppKeyInt();
         mailService.MailFrom = "*****@*****.**";
         mailService.MailTo = email.Text;
         mailService.MailBodyText = "This is the body of the mail";
         mailService.SendMail();
         result.Text = "Mail Sent";
         email.Text = string.Empty;
     }
     catch (Exception ex)
     {
         ExceptionUtils.WriteError(ex);
     }
 }
Пример #2
0
 private void Email(string emailId, string subject, string bodyText, string ccemail)
 {
     Ektron.Cms.CommonApi commonApi = new Ektron.Cms.CommonApi();
     Ektron.Cms.Common.EkMailService mailService = new Ektron.Cms.Common.EkMailService(commonApi.RequestInformationRef);
     mailService.MailServer = "EmailServerIP".GetAppKeyString();
     mailService.ServerPort = "EmailServerPort".GetAppKeyInt();
     mailService.MailFrom = "PaymentEmailFrom".GetAppKeyString();
     mailService.MailTo = emailId;
     if (ccemail != "")
     {
         mailService.MailCC = ccemail;
     }
     mailService.MailSubject = subject;
     mailService.MailBodyText = bodyText;
     mailService.SendMail();
 }