Firstly, you need to get your application in the white list from the documentation :
Requesting users email address requires your application to be included in the white list of Twitter.
If you get permission, you need to configure ConfigurationBuilder wtih setIncludeEmailEnabled(true)
ConfigurationBuilder builder = new ConfigurationBuilder(); builder.setOAuthConsumerKey(cKey); builder.setOAuthConsumerSecret(cSecret); builder.setOAuthAccessToken(accessToken.getToken()); builder.setOAuthAccessTokenSecret(accessToken.getTokenSecret()); builder.setIncludeEmailEnabled(true);
And then you can receive user mail after checking credentials
User user = twitter.verifyCredentials(); System.out.print(user.getEmail());
As Patrick Denny points out, this method works on October 4, 2016 on Twitter4j 4.0.5
So, if you have an older version and need to receive an email, please update
source share