I am working on a mailSender Class. I can’t use the Server.MapPath method from the System.Web.UI Namespace. What reference should i set to make this work? I have referenced to the System / System.Web / System.Web.UI.
This is the msdn i have checked.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Please read TaylorMichaelL answer on this page: The name ‘Server’ does not exist in the current context. This should help you.
A better approach though is that you add the target folder as a method argument and create the path from that. That way, the class will be usable in non-web contexts as well.