If the mail works for a while and then drops off, that's usually a problem with the network connection somewhere between the Mac and the mail server. Could be a flaky WiFi, or a bad cable, a bad modem or a problem further along in the wiring to your ISP. WiFi in villages and cities can encounter interference, for instance, and moving to a 5 GHz connection (if your equipment supports it) can help. ISP connections can be flaky and drop.
If your mail is offline solidly and this is not a transitory problem, then there's usually problem with the username, password, port or server name settings, or a connection has switched to requiring SSL/TLS. To test a connection that's entirely offline, use the Connection Doctor tool within Mail.app. (Window > Connection Doctor)
Verify your credentials with your ISP web mail interface, if your ISP offers that.
There are two parts to a mail connection. The incoming connection (usually POP or IMAP) that receives mail from the mail server, and the outgoing connection (SMTP or ESMTP) that sends the mail to the server. Mail.app "hides" the latter settings; you have to select the "edit server list" option to get to the SMTP mail server configuration. Check those against your particular ISP's requirements; you'll have to search for thiose.
If you're using a major ISP provider, post the name of the ISP, and somebody might be able to locate those mail server settings for you. (Verizon is apparently rolling out a change to their settings, for instance.)
Apple offers a web-based email setup assistant that might help determine the settings, too. That can help if you remove the existing account and re-add it, too.
For Optimum (Cablevision), edit your account
- under Outgoing Mail Server (SMTP)
- click on the dropdown menu (it might already say mail.optonline.net) and select Edit server list
- make sure mail.optonline.net is selected at the top
- click on Advanced and check Use custom port
- In the space provided enter 587
- even though, the default settting,"Use default ports (25, 465, 587)" includes 587, you may still have problems if you don't specify 587
- also make sure Authentication is set to Password and that you've included your User Name (your email address without the @optonlin.net) and your password.
- click OK and you should be working.