Send auto email programmatically [duplicate]

Referred link has correct answer, but there are written some libraries to make your work easy.

  • https://github.com/yesidlazaro/GmailBackground
  • https://github.com/thegenuinegourav/Android-Email-App-using-Javamail-Api
  • https://github.com/prashantwosti/BackgroundMailLibrary

So don't write all code again, just use any of these library and get your work done in little time.