0

I am developing an android app in which i need feedback option. I use the default Email Intent code but it's growing old you know, i need some code for sending email via the same app. Every thing they type in an Edit Text, should be the email body. You may have seen some apps using that & it saves the feedback messages also. It is just like a messanger. How can i?

2 Answers2

0

i would sent the email message with an ajax call to a webpage http://yourdomainname.com/sendemail.php

the page will recieve the email msg as post or get parameters and send it to your email

Ali
  • 595
  • 4
  • 13
  • 42
0

You can do that by setting a button and onbuttonclick you can send a email with edit text values as body. code for buttonclick

 button.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub

            Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
             String[] recipients = new String[]{"my@email.com", "",};
              emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, recipients);
              emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Test");
              emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "This is email's message");
              emailIntent.setType("text/plain");
              emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, 
                        "name:"+edt1.getText().toString()+'\n'+"address:"+edt2.getText().toString()+'\n'+"city:"+edt3.getText().toString()+'\n'+'\n'+edt4.getText().toString()+'\n'+'\n'+"Sent from the Lads to Leaders/Leaderettes Android App.");

              startActivity(Intent.createChooser(emailIntent, "Send mail..."));
              finish();

        }
    });
droid
  • 184
  • 13