Reputation: 970
Here i am going to do send my data on particular E-mail.
Data contains name of the sender,email of the sender and message of the sender. All above information to my mail.
Please, help me to solve out.
Upvotes: 1
Views: 1972
Reputation: 27221
I'm using this wrapper:
public static void sendEmail(Context ctx) {
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
String[] recipients = new String[]{"***[email protected]***"};// Replace your email id here
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, recipients);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "*TITLE*");// Replace your title with "TITLE"
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "");
emailIntent.setType("***text/plain***"); // set content type here
ctx.startActivity(Intent.createChooser(emailIntent, "Send E-mail..."));// it will provide you supported all app to send email.
}
Upvotes: 1
Reputation: 4132
First of all create the email where you want to get the feedback. So you have your email and your password.
Then create an activity that contains an EditText with an id
<EditText android:id="body"
android:layout .... />
<EditText android:id="useremail"
... />
<EditText android:id="username"
... />
just follow the link below: link
and fill the following info:
GMailSender sender = new GMailSender("[email protected]", "password");
sender.sendMail("Users Feedback",
"User Name:\t"+((EditText)getValueById(R.id.username).getText())+"\n"
+"User Email:\t"+((EditText)getValueById(R.id.useremail).getText())+"\n\n"
+"Content:\t"+((EditText)getValueById(R.id.body).getText()),
"[email protected]",
"[email protected]");
Upvotes: 1