Email is working when form is submitted, but the attachment is not being sent with it.. what im i doing wrong with the logic below: Also, would it be possible to add an attachment without uploading it to the server first?
if (Attach_Files.PostedFile != null)
{
/* Get a reference to PostedFile object */
HttpPostedFile attFile = Attach_Files.PostedFile;
/* Get size of the file */
int attachFileLength = attFile.ContentLength;
/* Make sure the size of the file is > 0 */
if (attachFileLength > 0)
{
/* Get the file name */
string strFileName = Path.GetFileName(Attach_Files.PostedFile.FileName);
/* Save the file on the server */
Attach_Files.PostedFile.SaveAs(Request.PhysicalApplicationPath + "tempAttach" + strFileName);
/* Create the email at ...
Go to the complete details ...