Can I send an email on my app?

Asked 2 years ago, Updated 2 years ago, 121 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.