private void sendRejectMail(string requestNo, string reason, string rejectLevel) { CommonMail mail = new CommonMail(); mail.From_address = "*****@*****.**"; string requestedUser = ""; requestedUser = getRequestedUser(requestNo); mail.To_address = getEmailOfUser(requestedUser); mail.Bcc_address = "*****@*****.**"; mail.Subject = "Cover Note Book Requested has been Rejected"; String BodyText; BodyText = "<html>" + "<head>" + "<title>Cover Note Book Requested has been Rejected</title>" + " <body> " + "<table>" + "<tr>" + "<td>" + "Cover Note Book request under request no. " + requestNo + " has been rejected from " + rejectLevel + " level." + "</td>" + "</tr>" + "<tr>" + "<td>" + "Reason for Reject - " + reason + "</td>" + "</tr>" + "</table>" + " </body> " + " </html>"; try { mail.Body = BodyText; mail.sendMail(); string notificationMsg = ""; notificationMsg = "Cover Note Book request under request no. " + requestNo + " has been rejected from " + rejectLevel + " level."; NotificationsHub nHub = new NotificationsHub(); nHub.NotifyClientForCoverNoteBookRequests("Cover Note Book Requested has been Rejected", notificationMsg, requestedUser); } catch (Exception ee) { ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true); } }
private void sendNotifyMailToBookRequester(string requestNo, string coverNoteBookNo) { CommonMail mail = new CommonMail(); mail.From_address = "*****@*****.**"; string requestedUser = ""; requestedUser = getRequestedUser(requestNo); mail.To_address = getEmailOfUser(requestedUser); mail.Bcc_address = "*****@*****.**"; mail.Subject = "Cover Note Book Issued"; String BodyText; BodyText = "<html>" + "<head>" + "<title>Cover Note Book Requested has been issued</title>" + " <body> " + "<table>" + "<tr>" + "<td>" + "The manual cover note book request made under request number " + requestNo + " is completed and the cover note book number, " + coverNoteBookNo + " has been issued now." + "</td>" + "</tr>" + "<tr>" + "</tr>" + "<tr>" + "<td>" + "Please confirm upon receiving." + "</td>" + "</tr>" + "</table>" + " </body> " + " </html>"; try { mail.Body = BodyText; mail.sendMail(); } catch (Exception ee) { ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true); } }
private void sendNotifyMailToBookIssuers(string requestNo) { CommonMail mail = new CommonMail(); mail.From_address = "*****@*****.**"; mail.To_address = getEmailOfBookIssueUser(System.Configuration.ConfigurationManager.AppSettings["CVR_NOTE_BOOK_ISSUER_MAIL_GROUP_NAME"].ToString()); mail.Bcc_address = "*****@*****.**"; string pageURl = ""; pageURl = "http://192.168.10.103:8045/Views/BookManagement/BookManager.aspx?pagecode=200"; mail.Subject = "Cover Note Book Ready to Issue"; String BodyText; BodyText = "<html>" + "<head>" + "<title>Cover Note Book Requested has been Approved and ready to issue</title>" + " <body> " + "<table>" + "<tr>" + "<td>" + "Cover Note Book request under request no. " + requestNo + " has been approved and ready to issue" + "</td>" + "</tr>" + "<tr>" + "<td>" + "Click <a href=\"" + pageURl + "\">here</a> to issue the book." + "</td>" + "</tr>" + "</table>" + " </body> " + " </html>"; try { mail.Body = BodyText; mail.sendMail(); } catch (Exception ee) { ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true); } }
public JsonResult BookTicket([FromBody] CustomerModel customer) { try { CommonMail common = new CommonMail(); List <TblCustomer> tblCustomers = new List <TblCustomer>(); string SeatNumber = ""; for (int i = 0; i < customer.SeatNumber.Count; i++) { SeatNumber += Convert.ToString(customer.SeatNumber[i]) + ','; } var customerName = new SqlParameter("CustomerName", customer.UserName); var Email = new SqlParameter("Email", customer.Email); var SeatNumbers = new SqlParameter("SeatNumbers", SeatNumber); var CustomerLst = cinemaBookingDBContext.TblCustomer .FromSqlRaw("EXECUTE dbo.SP_BookSheet @customerName,@Email,@SeatNumbers", customerName, Email, SeatNumbers) .ToList(); if (CustomerLst.Count != 0) { string MsgBody = ""; MsgBody += "Dear " + customer.UserName; MsgBody += "<br/>"; MsgBody += "Greetings!!"; MsgBody += "<br/>"; MsgBody += "Thank you for choosing our Booking Cinema System. Your Ticket Has Been Booked."; MsgBody += "<br/><table border=" + 1 + " cellpadding=" + 0 + " cellspacing=" + 0 + " width = " + 400 + "><tr><th>Seat Number</th><th>Secret Key</th></tr>"; for (int i = 0; i < CustomerLst.Count; i++) { MsgBody += "<tr><td>" + CustomerLst[i].SeatNumber + "</td><td>" + CustomerLst[i].SecretKey + "</td><tr>"; } MsgBody += "</table><br/>"; MsgBody += "Thanks<br/>Cinema Booking System"; common.SendMail(customer.Email, MsgBody, "Confirmation Ticket Booking"); return(Json(1)); } else { return(Json(0)); } } catch (Exception ex) { LogException(ex, "BookTicket"); return(Json(0)); } }
private void sendApprovalNotificationMailOfHNBToHDO() { ProposalUploadController proposalUploadController = new ProposalUploadController(); CommonMail mail = new CommonMail(); mail.From_address = "*****@*****.**"; mail.To_address = proposalUploadController.getEmailOfBranchStaff("TDA");//HDO FOR HNB mail.Cc_address = "*****@*****.**"; mail.Subject = "Uploaded HNB Proposal Processed and Ready to Print"; String BodyText; BodyText = "<html>" + "<head>" + "<title>Uploaded Proposal Processed and Ready to Print</title>" + " <body> " + "<table>" + "<tr>" + "<td>" + "Uploaded Proposal of Quotation No. " + txtQuotationNo.Text + " Processed and Ready to Print." + "</td>" + "</tr>" + "<tr>" + "<td>" + "TCS Policy No. - " + txtTCSPolicyNo.Text + "</td>" + "</tr>" + "</table>" + " </body> " + " </html>"; try { mail.Body = BodyText; mail.sendMail(); } catch (Exception ee) { ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true); } }
protected void btnEmail_Click(object sender, EventArgs e) { if (txtTo.Text == "") { lblMsg.Text = "To address cannot be empty"; return; } CommonMail mail = new CommonMail(); mail.From_address = "*****@*****.**"; if (txtTo.Text != "") { mail.To_address = txtTo.Text; } if (txtCc.Text != "") { mail.Cc_address = txtCc.Text; } mail.Subject = "Motor New Bussiness Documents"; String BodyText; BodyText = "Plese find the attachement"; mail.Attachment = (new Attachment(txtDocPath.Text, "Document.pdf")); mail.Body = BodyText; mail.sendMail(); lblMsg.Text = "Document successfully sent"; }
private void sendMailToPolicyOwnBranch(string branchCode, string policyNo) { ProposalUploadController proposalUploadController = new ProposalUploadController(); CommonMail mail = new CommonMail(); // mail.From_address = "*****@*****.**"; mail.From_address = "*****@*****.**"; mail.To_address = proposalUploadController.getEmailOfBranchStaff(branchCode); // mail.To_address = "*****@*****.**"; mail.Cc_address = "*****@*****.**"; //string pageURl = ""; //pageURl = Request.Url.AbsoluteUri; //// pageURl = pageURl.Replace("Quotation.aspx", "MRApprove.aspx"); //int index = pageURl.LastIndexOf("/"); //if (index > 0) //{ // pageURl = pageURl.Substring(0, index + 1); //} //pageURl = pageURl + "ProposalUploadView.aspx" + "?ProposalUploadId=" + txtProposalUploadId.Text; mail.Subject = "Upload Documents for Policy Cancellation"; String BodyText; BodyText = "<html>" + "<head>" + "<title>Upload Documents for Policy Cancellation</title>" + " <body> " + "<table>" + "<tr>" + "<td>" + "Please Upload Documents for Policy Cancellation of Policy No. " + policyNo + "</td>" + "</tr>" + "</table>" + " </body> " + " </html>"; try { mail.Body = BodyText; mail.sendMail(); } catch (Exception ee) { ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true); } }
private void sendApprovalNotificationMailForCancellation() { if (txtEnteredBranchCode.Text == "") { return; } ProposalUploadController proposalUploadController = new ProposalUploadController(); CommonMail mail = new CommonMail(); // mail.From_address = "*****@*****.**"; mail.From_address = "*****@*****.**"; mail.To_address = proposalUploadController.getEmailOfBranchStaff(txtEnteredBranchCode.Text); //mail.To_address = "*****@*****.**"; string enteredUserEmail = ""; enteredUserEmail = proposalUploadController.getEmailOfUser(txtProposalUploadUserCode.Text); if (enteredUserEmail != "") { mail.Cc_address = enteredUserEmail + ",[email protected]"; } else { mail.Cc_address = "*****@*****.**"; } mail.Subject = "Uploaded Proposal Cancelled and Ready to Print"; String BodyText; BodyText = "<html>" + "<head>" + "<title>Uploaded Proposal Cancelled and Ready to Print</title>" + " <body> " + "<table>" + "<tr>" + "<td>" + "Uploaded Proposal of Job No. " + txtJobNo.Text + " Cancelled and Ready to Print." + "</td>" + "</tr>" + "<tr>" + "<td>" + "TCS Policy No. - " + txtPolicyNo.Text + "</td>" + "</tr>" + "</table>" + " </body> " + " </html>"; try { mail.Body = BodyText; mail.sendMail(); } catch (Exception ee) { ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true); } }
private void sendRejectionMail(string jobNo) { if (txtEnteredBranchCode.Text == "") { return; } ProposalUploadController proposalUploadController = new ProposalUploadController(); CommonMail mail = new CommonMail(); // mail.From_address = "*****@*****.**"; mail.From_address = "*****@*****.**"; mail.To_address = proposalUploadController.getEmailOfBranchStaff(txtEnteredBranchCode.Text); //mail.To_address = "*****@*****.**"; string enteredUserEmail = ""; enteredUserEmail = proposalUploadController.getEmailOfUser(txtProposalUploadUserCode.Text); if (enteredUserEmail != "") { mail.Cc_address = enteredUserEmail + ",[email protected]"; } else { mail.Cc_address = "*****@*****.**"; } //string pageURl = ""; //pageURl = Request.Url.AbsoluteUri; //// pageURl = pageURl.Replace("Quotation.aspx", "MRApprove.aspx"); //int index = pageURl.LastIndexOf("/"); //if (index > 0) //{ // pageURl = pageURl.Substring(0, index + 1); //} //pageURl = pageURl + "ProposalUploadView.aspx" + "?ProposalUploadId=" + txtProposalUploadId.Text; mail.Subject = "Uploaded Proposal Details Rejected"; String BodyText; BodyText = "<html>" + "<head>" + "<title>Uploaded Proposal Details Rejected</title>" + " <body> " + "<table>" + "<tr>" + "<td>" + "Uploaded Proposal of Quotation No./Job No. " + jobNo + " Rejected" + "</td>" + "</tr>" + "<tr>" + "<td>" + "Reason for Reject - " + txtScrutinizeRemarks.Text + "</td>" + "</tr>" + "</table>" + " </body> " + " </html>"; try { mail.Body = BodyText; mail.sendMail(); } catch (Exception ee) { ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true); } }
private void sendRequestApprovalMail(string newRequestSeqNo, string requestNo, string branchCode, string newStatus) { if (newRequestSeqNo == "") { return; } string BOOK_REQ_PEND_APPR_BY_ZM = System.Configuration.ConfigurationManager.AppSettings["BOOK_REQ_PEND_APPR_BY_ZM"].ToString(); string BOOK_REQ_PEND_APPR_BY_HDO = System.Configuration.ConfigurationManager.AppSettings["BOOK_REQ_PEND_APPR_BY_HDO"].ToString(); string nextApprovePerson = ""; if (newStatus == BOOK_REQ_PEND_APPR_BY_ZM) { nextApprovePerson = getZonalApprovePersonName(branchCode); } else { nextApprovePerson = getNextApprovePersonName(branchCode); } string UserCode = ""; HttpCookie reqCookies = Request.Cookies["userInfo"]; if (reqCookies != null) { UserCode = reqCookies["UserCode"].ToString(); } ProposalUploadController proposalUploadController = new ProposalUploadController(); CommonMail mail = new CommonMail(); mail.From_address = "*****@*****.**"; mail.To_address = proposalUploadController.getEmailOfUser(nextApprovePerson); // mail.To_address = proposalUploadController.getEmailOfUser(UserCode); //string enteredUserEmail = ""; //enteredUserEmail = proposalUploadController.getEmailOfUser(UserCode); mail.Bcc_address = "*****@*****.**"; string pageURl = ""; pageURl = "http://192.168.10.103:8045/Views/BookManagement/"; pageURl = pageURl + "CoverNoteBookRequestApproval.aspx" + "?RequestSeqNo=" + newRequestSeqNo; mail.Subject = "Approval need for Cover Note Book Request"; String BodyText; BodyText = "<html>" + "<head>" + "<title>Approval need for Cover Note Book Request</title>" + " <body> " + "<table>" + "<tr>" + "<td>" + "Approval need for Cover Note Book Request under request no. " + requestNo + " ," + "</td>" + "</tr>" + "<tr>" + "<td>" + "Click <a href=\"" + pageURl + "\">here</a> to Approve/Reject the request." + "</td>" + "</tr>" + "</table>" + " </body> " + " </html>"; try { mail.Body = BodyText; mail.sendMail(); string notificationMsg = ""; notificationMsg = "Approval need for Cover Note Book Request under request no. " + requestNo + ""; NotificationsHub nHub = new NotificationsHub(); nHub.NotifyClientForCoverNoteBookRequests("Approval need for Cover Note Book Request", notificationMsg, nextApprovePerson); } catch (Exception ee) { ScriptManager.RegisterStartupScript(this, GetType(), "Message", "alert('Error while sending notification e-mail.');", true); } }
public JsonResult UnBookTicket(int SeatNumber) { try { var TicketStatus = repository.GetById(SeatNumber); string UserMail = ""; CommonMail common = new CommonMail(); string UserName = ""; string MsgBody = ""; if (TicketStatus != null && TicketStatus.BookingStatus == true) { var CustomerInform = repositoryCustomer.GetById(TicketStatus.CustomerId); UserMail = CustomerInform.Email; UserName = CustomerInform.CustomerName; repositoryCustomer.Delete(TicketStatus.CustomerId); repositoryCustomer.Save(); TicketStatus.BookingStatus = false; TicketStatus.CustomerId = 0; repository.Update(TicketStatus); repository.Save(); MsgBody += "Dear " + UserName; MsgBody += "<br/>"; MsgBody += "Greetings!!"; MsgBody += "<br/><br/>"; MsgBody += "Your Ticket (Seat Number) " + SeatNumber + " Has Been Cancelled."; MsgBody += "<br/><br/>"; MsgBody += "Thanks <br/>"; MsgBody += "Cinema Booking System"; common.SendMail(UserMail, MsgBody, "Cancelled Ticket Update"); } return(Json(1)); } catch (Exception ex) { LogException(ex, "UnBookTicket"); return(Json(0)); } }