The many reasons why this could be happening using any particular mail client. Below I have given 2 possible reasons why you could be having that type of error on Thunderbird. The 2 possible reason are Offline Mode and SMTP Settings.
Verify Thunderbird is in online mode, not offline mode: click "File -> Offline"; "Work Offline" should be unchecked. If you send a message while in offline mode, it goes to the Unsent Messages folder in Local Folders. See below for Advanced tips.
First, get the correct outgoing mail (SMTP) settings from your service provider.
Verify the settings in Thunderbird exactly match what your ISP provides: no typos (e.g., "smpt"), extra spaces, punctuation mistakes (e.g., no commas instead of periods) or capitalization errors (e.g., lowercase instead of Caps).
Click "Tools -> Account Settings -> Outgoing Server (SMTP)" (at the bottom of the left pane—you may need to scroll down), and double-check:
Port: Some service providers use non-standard ports (25 is standard). If you're having problems, ask them which ports they support for SMTP or outgoing e-mail.
Username and password: Check this box if your e-mail service provider supports or requires SMTP authentication. If you receive error messages when trying to send, try unchecking this box. Also, your username (if needed) might be your full e-mail address (e.g., "firstname.lastname@example.org") or only the part before the "@" ("johndoe"), depending on your service provider; check with them which is correct.
Use secure connection: Unless your service provider supports encrypted connections (SSL or TLS) for outgoing mail, select "No". If it supports or requires encrypted connections, choose the right method here. Your provider should provide you with that information, if not, ask them.
Also, click "Tools -> Account Settings -> [account name] Server Settings -> Advanced -> SMTP" and verify the correct SMTP server is selected there. If you see "Relay access denied" or "Relaying denied" errors, be sure to verify this setting. Some e-mail service providers require that you check for new messages before you can send messages.