The notices required by this article may be served on the contractor or on his or her agent having charge of the work, personally, or by registered mail addressed to the contractor or his or her agent, or, if neither can be located or their addresses are unknown, by posting in a conspicuous place upon the premises of the project.