I use Apple Mail to manage my emails. It works great most of the time, however for the past half year I have ran into problems sending emails, even when other accounts would work. The problem, it turns out, is not with Mail but with Gmail, and the Google Account settings. This problem started once I turned off 2-step authentication, having it on caused some problems. This problem was further compounded by the fact that other Google email accounts would work perfectly.
Google / Gmail Settings
At this point I am going to assume that the smtp settings for Gmail are correct, if you don’t know what they are you can find them here. The first step is to open your Google Account settings and open ‘Sign In & Security’.
The first step is to ensure 2-step authentication is off. Turn this option off at the top of the page. Then delete any application specific passwords. Ensure your original password is used in the smtp settings within Mail.
Then scroll down to the bottom of the page and turn on the less secure apps option.
Now, restart Mail and you should find that you can send out emails again.
To test the connection, you can always go to Window > Connection Doctor within Mail to see if it connects properly.
If this does work and you can send emails, it is always worth turning these options back on as they are more secure. I managed to do this after a day. I turned 2 step authentication and less secure options back to the original settings and everything worked again.