protected void GenerateQrScan() { string code = txtIDNumber.Text + txtName.Text + txtSurname.Text; QRCodeGenerator qrGenerator = new QRCodeGenerator(); QRCodeData qrCodeData = qrGenerator.CreateQrCode(code, QRCodeGenerator.ECCLevel.Q); QRCode qrCode = new QRCode(qrCodeData); System.Web.UI.WebControls.Image imgBarCode = new System.Web.UI.WebControls.Image(); imgBarCode.Height = 150; imgBarCode.Width = 150; using (Bitmap bitMap = qrCode.GetGraphic(20)) { using (MemoryStream ms = new MemoryStream()) { bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png); byte[] byteImage = ms.ToArray(); imgBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage); } PlaceHolder1.Controls.Add(imgBarCode); using (LoyaltyPointSystemEntities db = new LoyaltyPointSystemEntities()) { EmailBL EML = new EmailBL(); EML.Email("You have successfully Registered for Loyalty Points: " + txtName.Text + " " + txtSurname.Text, "Dear" + txtName.Text + "<br/> <br/>" + "This is your QrScan :" + "< img src = " + imgBarCode + " >" + "<br/>" + "Your application has been Approve. " + "<br/>" + "<br/>" + "This is an automatically generated email. Please do not reply. " + "<br/> <br/>" + "For more details feel free to call us on 031 455 4576." + "<br/> <br/>" + "Regards" + "<br/>" + "Loyalty Point", txtEmail.Text, "Loyalty Point", "*****@*****.**"); } } }
public void sendEmail() { using (LoyaltyPointSystemEntities db = new LoyaltyPointSystemEntities()) { EmailBL EML = new EmailBL(); EML.Email("Status Notification for Reference No: " + "refNo", "Dear Applicant" + "<br/> <br/>" + "Your Reference is :" + "refNo" + "<br/>" + "Your application has been Approve. " + "<br/>" + "<br/>" + "This is an automatically generated email. Please do not reply. " + "<br/> <br/>" + "For more details feel free to call us on 031 455 4576." + "<br/> <br/>" + "Regards" + "<br/>" + "Ethekwini Municipality", "*****@*****.**", "Ethekwini Municipality", "*****@*****.**"); } }