kaveer
2/19/2017 - 7:09 PM

Sent mail

Sent mail

 private void SentMail() {
        Intent i = new Intent(Intent.ACTION_SEND);
        i.setType("message/rfc822");
        i.putExtra(Intent.EXTRA_EMAIL  , new String[]{recipient.getText().toString().trim()}); // recipient here
        i.putExtra(Intent.EXTRA_SUBJECT, "Try VMS. Track your cars!!");
        i.putExtra(Intent.EXTRA_TEXT   ,
                "Hello,\n\n" +
                "I'm using vms app to track my vehicles on my Android phone/tablet and I would like to share my experience with you.\n\n" +
                "You can keep records of your cars and have all of them under control. Vms will help you to keep track of your fuel mileage and costs, maintenance, trips and general expenses of your vehicles.\n\n" +
                "You should try vms too!");
        try {
            startActivity(Intent.createChooser(i, "Send mail..."));
        } catch (android.content.ActivityNotFoundException ex) {
            Toast.makeText(getContext(), "There are no email clients installed.", Toast.LENGTH_SHORT).show();
        }
    }