Server.MapPath returning a path with a folder that doesn’t exists
问题 I have following code: var dir = @"Content\Posts\" + yr + @"\" + mnth + @"\"; var a = Path.Combine(dir, dy.ToString() + pId.ToString() + ".txt"); //a contains: "Content\\Posts\\2013\\8\\file01.txt" stts = obj.NotifyMail(title, writeup, "author@gmail.com", a); And than in NotifyMail function I have this: public bool NotifyMail(string subject, string body, string toAdd, string filePath) { … string attachments = HttpContext.Current.Server.MapPath(filePath); //NOW here attachments contains: "G:\