I have a textfield on my app, and a button. I only want that when user
press the button, my app have to send a email with the text “Hello” to
the direction on the textfield.
Is there a easy way to do it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First way.
If you don’t want to be linked to the native email program or gmail program (via intent) to send the mail, but have the email sent in the background, see the code below.
Firstly you need to import the following library in Gradle File:
Then you can use this helper class and adjust it to your needs.
And use this class:
Second way.
Another option, if you don’t mind using the native email client or gmail on Android for sending the mail (but the user actually has to hit the send button finally in the email client), you can do this: