"MQRC_Q_MGR_NAME_ERROR" means that you are successfully connecting to QMgr, but the name QMgr does not match the name in the connection request. For example, if my connection request is for QMGRA, and the IP and port to which I connect are QMGRB, I expect to get the error that you see. If my connection request does not specify the name QMgr, then which QMgr I am connecting to should accept the connection. Therefore, it seems that either the environment variable, or the CCDT file, or the line of code not shown in your question, points to the name QMgr pior for trying to connect. Unfortunately, it is impossible to indicate one of them as a reason without additional information.
Do not worry about the user1 identifier that gave you. If this were a problem, you would return 2035 MQRC_AUTHORIZATION_ERROR back. The identifier is not even verified until a connection can be made.
Here are a few links that can help you figure this out. These are WMQ v7 links. Since v6 is the end of life since September 2011, I hope that all new developments will be on v7. In addition, .NEt classes are integrated into the core WMQ product and are fully supported with v7.
MQCONN Call Examples http://bit.ly/9HG8tC
Connecting WebSphere MQ client applications to http://bit.ly/9eapRO queue managers
Using SSL with WMQ.Net Client http://bit.ly/9nXayP
T.Rob source share