Skip to content Skip to sidebar Skip to footer

Android Send Mail

In the following main.xml i have a edittext,my question is how to onclick of send mail button how to send a mail where the To address is hardcoded always.. mail.setOnClickListener

Solution 1:

 final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);     
emailIntent.setType("plain/text");     
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"youraddress@aaaaa.com"});     
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, yourSubject);     
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, yourBodyText);     
context.startActivity(Intent.createChooser(intent, "Send mail..."));

Post a Comment for "Android Send Mail"