Can I send an email on my app?

Asked 1 years ago, Updated 1 years ago, 108 views

I'm making an app. Can I have my app send me an email?

email android

2022-09-21 19:30

1 Answers

I think the easiest way is to use Intent.

Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822");
i.putExtra (Intent.EXTRA_EMAIL, new String[]{"Email Address"});
i.putExtra (Intent.EXTRA_SUBJECT, "Email Title");
i.putExtra (Intent.EXTRA_TEXT, "Email Content";
try {
    startActivity (Intent.createChooser (i, "Sending Email...");
} } catch (android.content.ActivityNotFoundException ex) {
    Toast.makeText (MyActivity.this, "No email address," Toast.LENGTH_SHORT).show();
}


2022-09-21 19:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.