It really depends on what you mean by mental illness. The term is much broader than I think the person asking the question realizes.
It is already against the law in most states for someone with a history of violence to purchase a gun (i.e. background checks are mandatory in many states). What qualifies as a history of violence does vary from state to state but generally if a person has severe mental illness to the point that they have a criminal record or have been actually committed then they probably can not purchase a firearm.
Another point which governing body would be enacting these suggested laws? The American national government has some pretty serious restrictions on what it is allowed to do regarding individual gun ownership but the American states have much greater authority to pass restrictions. So if the law was being debated in a state legislature and it was reasonable then I might support it but if it was being debated on the American national level I would oppose it - even if it was a good law - b/c the American national government simply lacks the authority to legislate on this matter absent an Amendment to our constitution.