In order to validly consecrate the Eucharist the priest needs to be validly ordained. This means that that he needs to have been ordained by a validly ordained Bishop. There are examples of validly ordained non-Catholics in the Eastern Orthodox Churches and various schismatic groups that have broken off of the Catholic Church throughout history (e.g. the Polish National Catholic Church).
When it comes to most mainline Protestant denominations, however, this is not the case. Most of them either did not maintain a valid line of Apostolic Succession or changed the theology of the sacraments so much as to render the intent of the minister invalid.
DISCLAIMER: Catholic Answers has turned over the archive to Catholic-Questions.org and no longer owns, manages, or moderates the forums. For additional apologetics resources please visit www.catholic.com.