The operation couldn’t be completed. (MCMailErrorDomain error 1045.)
I had the same problem in Mail / OS X 10.10.2.

After long searches for an answer, I solved the problem simply inserting again my passoword for the SMTP account. 

Even though the stored password was correct, it didn't work until I inserted again the password. Go figure why it didn't work before !!