If the SSN and Last & First name do not match that on record ( IRS uses Social Security Admin file) then the return would be rejected.
If you have recently updated SSA records or you have not, you will have to file by mail and include documents to prove the name change