I m working on a Sending mail functionality. In that I first create a pdf and then attach that PDF to the mail and send to the use.
Problem
1) is when I check for
I get value as false even though I can see the file.
2) even If i give the path of the pdf file using
I get exception.
I m not sure why this happening as if I send PDFFileNamePath with previously created file, it works fine.
But issue is with the recently created file.
Please help me on this issue as I have already wasted lot of time on this.
thanks in advance.
Problem
1) is when I check for
Code:
strPDFFile= Server.MapPath("~/HTMLReportSource/PDFSchedules/" & "ABC.pdf") If File.Exists(strPDFFile) Then strAttachmentPath = "~/HTMLReportSource/PDFSchedules/" & ViewState("VS2005_GENERATED_POLICY_NO") & ".pdf" Else strAttachmentPath = "" end if
2) even If i give the path of the pdf file using
Code:
attach = New Attachment(System.Web.HttpContext.Current.Server.MapPath(strAttachmentPath)) smail.Attachments.Add(attach )
I m not sure why this happening as if I send PDFFileNamePath with previously created file, it works fine.
But issue is with the recently created file.
Please help me on this issue as I have already wasted lot of time on this.
thanks in advance.
Comment