Gmail works for WordPress via SMTP only after lowering your security settings.
Allowing less secure apps to access your account
Google may block sign in attempts from some apps or devices that do not use modern security standards. Since these apps and devices are easier to break into, blocking them helps keep your account safer.
Some examples of apps that do not support the latest security standards include:
The Mail app on your iPhone or iPad with iOS 6 or below
The Mail app on your Windows phone preceding the 8.1 release
Some Desktop mail clients like Microsoft Outlook and Mozilla Thunderbird
Access your account
To help keep your account secure, we may block these less secure apps from accessing your account, and you’ll see a “Password incorrect” error when trying to sign in. If this is the case, you have two options:
Upgrade to a more secure app that uses the most up to date security measures. All Google products, like Gmail, use the latest security measures.
Go to Allow less secure apps and choose “Allow” to let less secure apps access your Google account. We don't recommend this option because it may make it easier for someone to gain access to your account.