The concept of smart microgrids has been shaped to locally provide electric power by distributed energy sources at the level of the low voltage system. Distributed power plants are located at close proximity to consumers and are employed for several reasons such as environmental problems of large power plants and their low efficiency, high costs of production and transmission and distribution, etc. The energy management system plays a vital role in coordinating the various devices in smart distribution microgrids. A precise and targeted work plan must be considered to accurately use the equipment and resources in distribution networks for increasing efficiency. Furthermore, the optimal operation of power systems requires proper planning. In this study, the planning and implementation of location and the determination of the optimal capacity of distributed generation plants are discussed to reduce the losses, costs, and environmental pollutions for exploiting smart microgrids in the network. Considering supply constraints and distributed generation sources constraints, the optimal operation of production is examined based on the genetic algorithm for different objectives such as the lowest pollution, losses and the cost of installation and operation. Based on the proposed model, the cost, lose, and emission functions are simultaneously considered for the target function. Finally, the presented results illustrate the high accuracy of the utilized approach for managing the energy resources.