Here is the code in Illinois about what you asked. Illinois has one of the stricter codes, so I say its best to ask your city plumbing inspector what your requirements are.
d)Relief Discharge Outlet.
1) A relief discharge outlet shall be indirectly connected to waste. The discharge pipe from the relief valve shall not be located so as to create a safety hazard or to discharge in such a way as to cause damage to the building or its contents. The relief valve shall not discharge through a wall into the outside atmosphere or where there is a possibility of freezing.
2) No reduced coupling, valve or any other restriction shall be installed in the discharge line of any relief valve that would impede the flow of discharge. The discharge line shall be installed from the relief valve to within 6 inches of the floor or receptor and the end of such line shall not be threaded.
3) Any piping used for discharge from the relief valve shall be of metallic material and conform with the requirements of Appendix A, Table A (Approved Materials for Water Distribution Pipe) for potable water piping and shall drain continuously downward to the outlet.
4) The discharge piping shall discharge indirectly into a floor drain, hub drain, service sink, sump or a trapped and vented P-trap which is located in the same room as the water heater. (See Sections 890.1010 and 890.1050(a), (b) and (c).) The trap must have a deep seal to protect against evaporation or shall be fed by means of a priming device designed and installed for that purpose. (The use of a light grade oil in the trap will retard evaporation.)