I could send mail from my Activity when i have already configured with any email account in android.
But in case if have not configured, is there any way to launch email setup screen from my Activity ,or at least check whether email account is setup before sending a email.
If i haven’t set up my email account then the following code takes me to compose SMS/MMS,which i don’t want ,Please give your suggestion.
Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.putExtra(Intent.EXTRA_EMAIL, "example.com");
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "...");
emailIntent.putExtra(Intent.EXTRA_TEXT,"...");
emailIntent.setType("text/plain");
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
CommonsWare is right, there is no e-mail setup screen in Android as there is no default e-mail app. So you need to tell the user to setup an e-mail account before attempting to send e-mail.
To do this, set the intent type to “message/rfc822”. This will call only the apps which can handle that MIME, in short, the e-mail apps.
Put startActivity in try, catch ActivityNotFoundException. When this exception is caught, you can inform the user to setup an e-mail account.