The password dialog is sometimes used for unrelated errors such as networking errors, for keychain errors, and corruptions to the account entry within mail; it's sometimes a problem connecting to or that's returned from the mail server, or an attempt to get to the mail server.
As a starting point, launch the Connection Doctor tool, and see what it reports.
Mail.app > Window > Connection Doctor
That will confirm the basic pieces and the connection to the mail server are all working. Or not.
Do you have one, two or more entries in the left colum of Mail.app for your mail server(s)? That is, do you have your Mail.app set up with either a btinternet entry, with a btyahoo entry, or both? Or more?
I'm guessing that you might have one account (btyahoo?) listed for incoming (IMAP server) mail, and with the outbound (SMTP server) mail is configured and named btinternet.
Based on what little I see posted, it looks like BT uses both btinternet and btyahoo, but I'm not exactly clear on how they have their stuff set up, and their web set gets helpful and tries to help configure my mail — I don't immediately see a single web page with the mail server set-up details. The BT email client set-up starts here.