TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mohammad Aman
Tech Writer
327
72.2k
generated pdf download and send to a email id using iTextSha
Mar 3 2016 4:53 AM
I am using iTextSharp to generate pdf file but i want to send that pdf to a email address. How can send generated pdf file to email using my given code. Please help me.
How to send pdf in email using MailSender() function.
Using sw As New StringWriter()
Using hw As New HtmlTextWriter(sw)
repeaterName.RenderControl(hw)
Dim sr As New StringReader(sw.ToString())
Dim pdfDoc As New Document(PageSize.A4, 50.0F, 50.0F, 40.0F, 50.0F)
Dim writer As PdfWriter = PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
pdfDoc.Open()
XMLWorkerHelper.GetInstance().ParseXHtml(writer, pdfDoc, sr)
pdfDoc.Close()
Response.ContentType = "application/pdf"
Response.AddHeader("content-disposition", "attachment;filename=" + ViewState("BillNo").ToString() + "_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".pdf")
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Write(pdfDoc)
Response.End()
End Using
End Using
Reply
Answers (
3
)
How to do DataAnnotation in database first approach
timesheet in asp