I am creating a store procedure but while executing the procedure i am getting the particular error.
Msg 217, Level 16, State 1, Procedure SendMail_Renewapp,
Ok, So this one is pretty old, so I figured I would provide the correct answer. You should add SET NOCOUNT ON at the top of the stored procedure and SET NOCOUNT OFF before you attempt to return a result (your final select).
Without this statement, your execution will treat every select statement as a result to output. When an external ADO or ADO.NET attempts to call the stored procedure and get a result, you will get the "Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)" message. Its the select statement for your cursor that is blowing things up.
reference: https://docs.microsoft.com/en-us/sql/t-sql/statements/set-nocount-transact-sql?view=sql-server-ver15