Hi I have got this edit text field, when I click on this button I want what ever is on the edit text box to be emailed to a specific email address. How do I go about doing that ?
findViewById(R.id.submit).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
"mailto", "email@email.com", null));
intent.putExtra(Intent.EXTRA_SUBJECT, "");
intent.putExtra(Intent.EXTRA_TEXT, R.id.feedback_comment);
startActivity(Intent.createChooser(intent, "Choose an Email client :"));
}
});
as you can see my edit text id is "feedback_comment". And I am passing that in the message.
I would also like to know if there is any way I could send this email in the background so that user doesn't have to see all of this in the front end. You click on the submit button and it sends the email to the specified address without having to play around on sending an email. I had a look at JavaMail and don't know where to start off, please someone help me start off. Thank You