Future distribution grids are expected to face an increasing penetration of electric vehicles (EVs) and heterogeneous distributed energy resources (DERs). This demands a distributed energy management (EM) to manage power generation and delivery of energy sources to maintain power quality under the impact of EV charging, to save operating costs, and to enhance resiliency. However, the global optimality of the distributed EM's optimization problem is still an issue in existing works because of the non-convex nature of the optimization problem. In this paper, a distributed EM strategy for grid-connected distribution networks is proposed. In particular, the EM strategy is composed of two steps. In the first step, some conditions of the EM optimization task are relaxed to apply an algorithm converging to the global optimality. The results of the first step are used to reconfigure constraints of the full optimization problem in Step 2. The proposed scheme is validated by implementing the real-time controller-hardware-in-the-loop (CHIL) experimentation on the IEEE 33 bus system. To study the impact of EV charging, EV data is collected from the market and the literature to generate realistic EV load profiles to demonstrate the effectiveness of the proposed strategy on saving operating costs and maintaining power quality.