I have the following code:
var dir = @"Content\Posts\" + yr + @"\" + mnth + @"\";
var a = Path.Combine(dir, dy.ToString() + pId.ToString() + ".txt");
stts = obj.NotifyMail(title, writeup, "author@gmail.com", a);
And than in the NotifyMail function I have this:
public bool NotifyMail(string subject, string body, string toAdd, string filePath)
{
…
string attachments = HttpContext.Current.Server.MapPath(filePath);
var attchmnts = new LinkedResource(attachments);
attchmnts.ContentId = "attchmnts";
…
}
Now the problem is in NotifyMailwhen it attachmentsretrieves the path of the physical file through Server.MapPath, returning the path with the invalid folder included in it, i.e. Postthis folder does not exist anywhere, even in the hard drive, and I have no idea how it was raised and returned. But he said that because of this problem he LinkedResource(attachments);throws an exception:
{"Could not find a part of the path ‘G:\\Program Files\\Derby\\Work\\Development\\proj\\proj\\Post\\Content\\Posts\\2013\\8\\file01.txt"’
source
share