var doc = new Document(); System.IO.MemoryStream Memory = new System.IO.MemoryStream(); PdfWriter writer = PdfWriter.GetInstance(doc, Memory); try { doc.Open(); Paragraph pp = new Paragraph("Collage of Management, Computer and Secretarial Training\n 353 West Street Salisbury Centre,\n Tower C,6th Floor Durban 4000,\nTel:Fax:031-305-2086"); pp.Alignment = Element.ALIGN_RIGHT; Paragraph paragraph1 = new Paragraph("\n\n\nDear " + ap.Fname + " " + ap.LastName); Paragraph paragragh2 = new Paragraph("\n\nThank you for applying for " + Course_Name(Convert.ToInt32(ap.CourseApplied)) + " at our collage."); Phrase pharse = new Phrase("\nWe are glad to inform you that your application has been accepted. We would like you to come with a copy of your id document, the admission number which is " + Request["AppID"] + " and metric certificate as well as your CV on the following date " + txtDateOfRegistration.Text + " for registration at our collage thank you"); Chunk footer1 = new Chunk("\n\n\nSincerely"); Chunk footer2 = new Chunk("\nMr. Vela Langa"); doc.Add(pp); doc.Add(paragraph1); doc.Add(paragragh2); doc.Add(pharse); doc.Add(footer1); doc.Add(footer2); } catch (DocumentException dex) { } catch (System.IO.IOException ioex) { } catch (Exception ex) { //Handle Other Exception } finally { writer.CloseStream = false; doc.Close(); //Close document Memory.Position = 0; CollegeConnection.Utilities.Send_EmailwithAttachment(txtSubject.Text, txtBody.Text, txtTo.Text, Memory); CollegeClass.Applicants.UpdateApplicantStatus(int.Parse(Request["AppID"])); Response.Redirect("ManManageApplications.aspx?Gritter=1"); } } else { lblError.Visible = true; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)