A segment-to-segment mortar frictionless contact method for total-Lagrangian smoothed particle hydrodynamics is presented in this work. The smoothed particle hydrodynamics method employs Lagrangian kernel, kernel gradient correction, and hourglass control to improve its accuracy, convergence property, and stability. Two formulations, the node-to-segment and mortar segment-to-segment, are employed to solve contact problems. The enforcement of contact constraints is performed using the penalty method and perturbed Lagrange method in the node-to-segment and mortar formulations, respectively. The algorithms and implementations of the two contact formulations are detailed. The performance of the two contact formulations is checked with several numerical examples. It is found that the mortar formulation gives robust simulations and more accurate results.