0

I want to send email from my application without configuration email in android device. can we do this?? we click a button and mail will automatically to the recipient.

I have used the following code. where we can give the sender name. and can we send mail via android emulator.

Thanx.

 Intent intent = new Intent(Intent.ACTION_SEND);
 intent.setType("text/plain");
 intent.putExtra(Intent.EXTRA_EMAIL , new String[]{"[email protected]"});
 intent.putExtra(Intent.EXTRA_SUBJECT, "Request For Quote");
 intent.putExtra(Intent.EXTRA_TEXT , "Hi....");
 try {
 //startActivity(Intent.createChooser(intent, "Send mail..."));
 startActivity(intent);
 //Toast.makeText(SendingEmailActivity.this, "Mail Sent Successfully", Toast.LENGTH_SHORT).show();
 } catch (android.content.ActivityNotFoundException ex) {
 Toast.makeText(DemoActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
 } 
asked May 27, 2011 at 8:26

2 Answers 2

1
answered May 27, 2011 at 8:38
Sign up to request clarification or add additional context in comments.

Comments

0

Without any intervention, you couldn't use Intents.

Take a look at This tutorial about javamail and android

answered May 27, 2011 at 8:32

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.