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?
Asked
Active
Viewed 286 times
0
-
May just be misreading but your question and title seem to differ – zgc7009 May 31 '14 at 12:20
-
1I added two more lines, please read it once again. – May 31 '14 at 12:21
-
and sorry for my horrible english. – May 31 '14 at 12:24
-
@RandomGuy take a look on this [Post](http://stackoverflow.com/questions/9882680/adding-text-from-edit-text-field-into-an-email?rq=1) – M D May 31 '14 at 12:29
2 Answers
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